Difference between revisions of "Activating second disk on ubuntu"

From Finninday
Jump to: navigation, search
(The cunning plan)
(The cunning plan)
Line 162: Line 162:
 
   Device /dev/sdb not found (or ignored by filtering).
 
   Device /dev/sdb not found (or ignored by filtering).
 
</pre>
 
</pre>
 +
But pvscan says this:
 +
<pre>
 +
root@weasel:/# pvscan
 +
  /dev/evms/lvm2/VolGroup00/LogVol00: read failed after 0 of 4096 at 0: Input/output error
 +
  PV /dev/sda5  VG Ubuntu  lvm2 [232.64 GB / 0    free]
 +
  PV /dev/sdb1              lvm2 [232.88 GB]
 +
  Total: 2 [465.53 GB] / in use: 1 [232.64 GB] / in no VG: 1 [232.88 GB]
 +
</pre>
 +
So I guess I don't need to pvcreate anything.  But how do I go from here to having useable mountpoint?
 +
 +
 +
 
* I no longer intend to assign this new disk to the existing volume group.  Instead, I'm going to make a different mount point and filesystem for editing video.  Hopefully, this will allow me to partition my disk failures.
 
* I no longer intend to assign this new disk to the existing volume group.  Instead, I'm going to make a different mount point and filesystem for editing video.  Hopefully, this will allow me to partition my disk failures.
  
 
But I don't plan on making any of these changes until I've slept on it for a few days.
 
But I don't plan on making any of these changes until I've slept on it for a few days.

Revision as of 23:16, 26 September 2006

I have two disks installed on my ubuntu dapper machine. Each is 250GB. But only one of them appears to be mounted and usable. This has been the case since my initial install of Ubuntu on this machine. I'm not sure how I confused the installer so badly. But I clearly did not understand the subtleties of LVM.

Collected data

root@weasel:/var/log# df -kh
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/Ubuntu-root
                      224G   87G  125G  42% /
varrun               1007M  208K 1007M   1% /var/run
varlock              1007M  4.0K 1007M   1% /var/lock
udev                 1007M  108K 1007M   1% /dev
devshm               1007M     0 1007M   0% /dev/shm
lrm                  1007M   22M  986M   3% /lib/modules/2.6.15-26-amd64-k8/volatile
/dev/sda1             228M  102M  115M  48% /boot

Logical volume manager (LVM) has something to do with this.

root@weasel:/var/log# fdisk -l

Disk /dev/sda: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          31      248976   83  Linux
/dev/sda2              32       30401   243947025    5  Extended
/dev/sda5              32       30401   243946993+  8e  Linux LVM

Disk /dev/sdb: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1       30401   244196001   8e  Linux LVM


The end of the LVM Howto has some common tasks and how to do them. I noticed the pvdisplay command:

root@weasel:/etc/lvm# pvdisplay
  /dev/evms/lvm2/VolGroup00/LogVol00: read failed after 0 of 4096 at 0: Input/output error
  Couldn't find device with uuid 'Y67lyo-mEdN-F0un-yPLl-HCTa-hWLC-mCentd'.
  --- Physical volume ---
  PV Name               unknown device
  VG Name               VolGroup00
  PV Size               232.78 GB / not usable 0
  Allocatable           yes (but full)
  PE Size (KByte)       32768
  Total PE              7449
  Free PE               0
  Allocated PE          7449
  PV UUID               Y67lyo-mEdN-F0un-yPLl-HCTa-hWLC-mCentd

  --- Physical volume ---
  PV Name               /dev/sdb1
  VG Name               VolGroup00
  PV Size               232.88 GB / not usable 0
  Allocatable           yes
  PE Size (KByte)       32768
  Total PE              7452
  Free PE               2
  Allocated PE          7450
  PV UUID               mh0UHf-UYhT-NOj8-Ddlv-3NVL-hKBW-enhOXu

  --- Physical volume ---
  PV Name               /dev/sda5
  VG Name               Ubuntu
  PV Size               232.64 GB / not usable 0
  Allocatable           yes (but full)
  PE Size (KByte)       4096
  Total PE              59557
  Free PE               0
  Allocated PE          59557
  PV UUID               hzY3In-XHIh-RGwS-1ilj-nL6P-Ajts-KmySkw

There's a volume group display command as well:

root@weasel:/etc/lvm# vgdisplay
  /dev/evms/lvm2/VolGroup00/LogVol00: read failed after 0 of 4096 at 0: Input/output error
  /dev/evms/lvm2/VolGroup00/LogVol00: read failed after 0 of 4096 at 0: Input/output error
  Couldn't find device with uuid 'Y67lyo-mEdN-F0un-yPLl-HCTa-hWLC-mCentd'.
  Couldn't find all physical volumes for volume group VolGroup00.
  /dev/evms/lvm2/VolGroup00/LogVol00: read failed after 0 of 4096 at 0: Input/output error
  /dev/evms/lvm2/VolGroup00/LogVol00: read failed after 0 of 4096 at 0: Input/output error
  Couldn't find device with uuid 'Y67lyo-mEdN-F0un-yPLl-HCTa-hWLC-mCentd'.
  Couldn't find all physical volumes for volume group VolGroup00.
  Volume group "VolGroup00" doesn't exist
  --- Volume group ---
  VG Name               Ubuntu
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  3
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                2
  Open LV               2
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               232.64 GB
  PE Size               4.00 MB
  Total PE              59557
  Alloc PE / Size       59557 / 232.64 GB
  Free  PE / Size       0 / 0
  VG UUID               85vnO6-FtRR-SZnS-s0UQ-aFNf-OY5X-ZiwMm0


Physical volume scan (pvscan) shows this:

root@weasel:/etc/lvm# pvscan
  /dev/evms/lvm2/VolGroup00/LogVol00: read failed after 0 of 4096 at 0: Input/output error
  /dev/evms/lvm2/VolGroup00/LogVol00: read failed after 0 of 4096 at 0: Input/output error
  Couldn't find device with uuid 'Y67lyo-mEdN-F0un-yPLl-HCTa-hWLC-mCentd'.
  PV unknown device   VG VolGroup00   lvm2 [232.78 GB / 0    free]
  PV /dev/sdb1        VG VolGroup00   lvm2 [232.88 GB / 64.00 MB free]
  PV /dev/sda5        VG Ubuntu       lvm2 [232.64 GB / 0    free]
  Total: 3 [698.30 GB] / in use: 3 [698.30 GB] / in no VG: 0 [0   ]

Analysis

It looks to me like I have two volume groups named VolGroup00 and Ubuntu. The Ubuntu volume group is working, but the VolGroup00 is not. Device /dev/sda5 is associated with Ubuntu and /dev/sdb1 is associated with VolGroup00.

The cunning plan

I think the steps toward a working configuration are these:

  • remove logical volumes in VolGroup00?
lvremove /dev/???
  • remove volume group VolGroup00
vgchange -a n VolGroup00
vgremove VolGroup00

The above commands failed with the error that it couldn't find VolGroup00. But it recommended that I could consider using the command: vgreduce --removemissing. I did the following:

vgreduce --test --removemissing VolGroup00
vgreduce --removemissing VolGroup00
vgreduce --test --removemissing VolGroup00

Luckily, my existing data in the Ubuntu volume group is un-destroyed.

Now vgscan says this:

root@weasel:/# vgscan
  Reading all physical volumes.  This may take a while...
  /dev/evms/lvm2/VolGroup00/LogVol00: read failed after 0 of 4096 at 0: Input/output error
  Found volume group "VolGroup00" using metadata type lvm2
  Found volume group "Ubuntu" using metadata type lvm2
  • initialize /dev/sdb1?
pvcreate -M2 /dev/sdb

Unfortunately, I got this back:

root@weasel:/# pvcreate -M2 /dev/sdb
  Device /dev/sdb not found (or ignored by filtering).

But pvscan says this:

root@weasel:/# pvscan
  /dev/evms/lvm2/VolGroup00/LogVol00: read failed after 0 of 4096 at 0: Input/output error
  PV /dev/sda5   VG Ubuntu   lvm2 [232.64 GB / 0    free]
  PV /dev/sdb1               lvm2 [232.88 GB]
  Total: 2 [465.53 GB] / in use: 1 [232.64 GB] / in no VG: 1 [232.88 GB]

So I guess I don't need to pvcreate anything. But how do I go from here to having useable mountpoint?


  • I no longer intend to assign this new disk to the existing volume group. Instead, I'm going to make a different mount point and filesystem for editing video. Hopefully, this will allow me to partition my disk failures.

But I don't plan on making any of these changes until I've slept on it for a few days.