5

I have had a 2 disk LVM called Data going for about 6 months, and I recently bought a third disk. I installed the disk in the machine, and wanted to format it and extend the lvm onto it, like I've done before. The system refused to format the disk, claiming it was already in use. I looked around for possible solutions, and ended up using dmsetup remove_all. This allowed me to format the new drive, but now it seems the system has problems with one of the two disks in the lvm. I don't know what the next step is.

Will try to include as much info as I can. Sda is a 500gb disk for system/swap etc. Sdb and sdc are the two already existing disks, and sdd is the newest addition. Sdb, sdc and sdd are all 3TB disks. I basically just want the lvm restored, and possibly the new disk included in it. It seems like the solution is right in front of me, I just don't quite know what to do.


  root@Localhost:~$ sudo lvdisplay

  Couldn't find device with uuid DLdcnb-5EzK-Vhw2-3M10-8JG8-R0X1-OjWyW2.
  --- Logical volume ---
  LV Path                /dev/Data/cargo
  LV Name                cargo
  VG Name                Data
  LV UUID                avSFsQ-J49l-twOa-j9KM-Dkeg-JDBE-aG1yWC
  LV Write Access        read/write
  LV Creation host, time Enterprise, 2013-09-22 18:32:06 +0100
  LV Status              NOT available
  LV Size                5.46 TiB
  Current LE             1430792
  Segments               2
  Allocation             inherit
  Read ahead sectors     auto

root@Localhost:~$ sudo vgdisplay

  Couldn't find device with uuid DLdcnb-5EzK-Vhw2-3M10-8JG8-R0X1-OjWyW2.
  --- Volume group ---
  VG Name               Data
  System ID             
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  4
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                1
  Open LV               0
  Max PV                0
  Cur PV                2
  Act PV                1
  VG Size               5.46 TiB
  PE Size               4.00 MiB
  Total PE              1430792
  Alloc PE / Size       1430792 / 5.46 TiB
  Free  PE / Size       0 / 0   
  VG UUID               rR2QmV-cbjs-rOYu-fU62-uEXp-cVfJ-xVHgRp

root@Localhost:~$ sudo vgchange -ay

  Couldn't find device with uuid DLdcnb-5EzK-Vhw2-3M10-8JG8-R0X1-OjWyW2.
  Refusing activation of partial LV cargo. Use --partial to override.
  0 logical volume(s) in volume group "Data" now active

root@Localhost:~$ sudo vgchange -ay --partial

  Partial mode. Incomplete logical volumes will be processed.
  Couldn't find device with uuid DLdcnb-5EzK-Vhw2-3M10-8JG8-R0X1-OjWyW2.
  Cannot activate Data/cargo: all segments missing.
  0 logical volume(s) in volume group "Data" now active

root@Localhost:~$ sudo blkid

/dev/sda7: UUID="200fea91-eed3-4634-8303-ef777e6e60a3" TYPE="swap" 
/dev/sdb: UUID="jH6LUK-hTsX-035m-mdSY-zfHp-oBaR-THVnC2" TYPE="LVM2_member" 
/dev/sda1: UUID="6144b690-afdd-4bd4-a095-a35da926f6bc" TYPE="ext4" 
/dev/sda5: UUID="73df5ee2-33fb-495e-ad20-ad33f82996b1" TYPE="ext4" 
/dev/sda6: UUID="d7a9d483-ed4a-4220-bf57-576723c636b8" TYPE="ext4" 
/dev/sda8: UUID="b5a9d030-d3af-4dfe-b72a-8180128caa11" TYPE="ext4" 
/dev/sda9: UUID="a7c62a16-62ee-406d-ad97-4887c823f40f" TYPE="ext4" 
/dev/sdd1: UUID="mWr3pU-WDNn-8cG2-Xt0z-fZvo-wzLe-wK7Dv3" TYPE="LVM2_member" 

root@Localhost:~$ sudo fdisk -l

Disk /dev/sda: 500 GB, 500105249280 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System 
/dev/sda1   *           1          43      345366   83  Linux
Warning: Partition 1 does not end on cylinder boundary.
/dev/sda2              43       60802   488046667    5  Extended
Warning: Partition 2 does not end on cylinder boundary.
/dev/sda5              43        1137     8787555   83  Linux
Warning: Partition 5 does not end on cylinder boundary.
/dev/sda6            1137        1502     2931862   83  Linux
Warning: Partition 6 does not end on cylinder boundary.
/dev/sda7            1502        2285     6289447   82  Linux swap
Warning: Partition 7 does not end on cylinder boundary.
/dev/sda8            2285        2334      393592   83  Linux
Warning: Partition 8 does not end on cylinder boundary.
/dev/sda9            2334       60802   469644210   83  Linux
Warning: Partition 9 does not end on cylinder boundary.
Error: /dev/sdb: unrecognised disk label
Error: /dev/sdc: unrecognised disk label

Disk /dev/sdd: 3000 GB, 3000590369280 bytes
255 heads, 63 sectors/track, 364801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System 
/dev/sdd1               1      364802  2930272033   83  Linux 
Warning: Partition 1 does not end on cylinder boundary.

picard@Enterprise:~$ sudo pvdisplay -C
  Couldn't find device with uuid DLdcnb-5EzK-Vhw2-3M10-8JG8-R0X1-OjWyW2.
  PV             VG   Fmt  Attr PSize PFree
  /dev/sdb       Data lvm2 a--  2.73t    0 
  /dev/sdd1           lvm2 a--  2.73t 2.73t
  unknown device Data lvm2 a-m  2.73t    0 
  • 1
    off-topic comment, but why would you use sudo commands as the root user? – Stefan Apr 16 '14 at 13:29
  • Because I did a find/replace of myuser@computername with root/localhost. So I'm not actually root. Just for the purpose of this. I can see how that'd backfire now! – Dalif Apr 16 '14 at 14:01
  • Why would you format a drive before pvcreate, vgextend and so on? That makes very little sense. Also output of pvdisplay -C might be of some use here as well. – Sami Laine Apr 16 '14 at 17:49
  • Edited with pvdisplay -C I don't have a specific reason for formating a drive before assimilating it in an LVM. I am not a complete newbie, but I'm not really advanced either, so sometimes I rely on online guidance. I didn't know I didn't have to format and put a filesystem on there first. – Dalif Apr 16 '14 at 18:12
2

You screwed up. You were told you couldn't format the disk because it was in use. It was in use. You were trying to format one of the existing disks, not the new one. Now you formatted the existing drive and lost your data. You will need to restore from backup.

You can see from the pvdisplay output that /dev/sdd1 is 100% free, so that seems to be the new drive.

  • I see how that might appear to be the case, but the disks were 'sdb' and 'sdc' before adding the new disk, that then became sdd. I never messed with either sdb or sdc, excent dmsetup remove_all. If I take out the new disk, sdb and unknown device remains. – Dalif Apr 17 '14 at 9:29
  • @Dalif, those device names are not stable and can change over a reboot, even if you don't add or remove any drives. Just because you gained an sdd when you added the new disk does not mean that drive is the new disk. Why would you think removing the new disk would change anything? You have unknown device because one of the old disks has been formatted and is no longer recognized. – psusi Apr 17 '14 at 13:31
  • Alright, I did not know that. Well I guess I'll learn from this. At least one of the drives are still intact. Thanks for your input and time. I'll use UUIDs exclusively in the future. – Dalif Apr 17 '14 at 15:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.