Difference between revisions of "Activating second disk on ubuntu"

From Finninday
Jump to: navigation, search
(Collected data)
(Collected data)
Line 38: Line 38:
  
  
The end of the [[http://tldp.org/HOWTO/LVM-HOWTO/ LVM Howto]] has some common tasks and how to do them.  I noticed the pvdisplay command:
+
The end of the [http://tldp.org/HOWTO/LVM-HOWTO/ LVM Howto] has some common tasks and how to do them.  I noticed the pvdisplay command:
 
<pre>
 
<pre>
 
root@weasel:/etc/lvm# pvdisplay
 
root@weasel:/etc/lvm# pvdisplay

Revision as of 04:11, 12 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.

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
  • initialize /dev/sdb1?
pvcreate /dev/sdb
  • assign /dev/sdb1 to Ubuntu
vgextend Ubuntu /dev/sdb1