Failed increase LVM volume size

Lee Ryan's picture

Hi All,

I was running out of space on my root partition for an OTRS instance of Turnkey-Linux, so I tried to follow the instructions given on blog entry:

I first powered down the Turnkey VM, increased the virtual disk size in XenServer from 8GB to 16GB, and started the VM again.

Once it had loaded, I started cfdisk, and created a new partion (sda6) filling up the 8GB free space.

I then ran pvcreate /dev/sda6, but it gave me a message (that I not longer have access to) but suggested the device didn't exist. So I restarted the VM (as I thought the post had suggested).

But now when I boot the VM, I get the following: ALERT! /dev/mapper/turnkey-root does not exist. Dropping to a shell! ...and then loads BusyBox to a RAMdisk.

dmesg shows sda still has partitions: sda1 sda2 < sda5 sda6 >

blkid only shows sda1 (assuming this is /boot)

I have tried googling this, and the pages I found seem to omit assumed knowledge... I am at a loss!


EDIT: I have also run lvm from the (initramfs) prompt - vgscan and pvscan all come up blank.

EDIT #2: After running lvm from the (initramfs) prompt, and running pvscan -vv I saw:

/dev/sda5: size is 16273409 sectors
/dev/sda5: size is 16273409 sectors
/dev/sda5: Label for sector 1 found at sector 2 - ignoring
/dev/sda5: No label detected

Thanks in advance for any help.

Landis Arnold's picture

If you can build a new Base Appliance with a bigger LVM system you might find it easier just to do a TKLBAM-Restore to get a bigger system.   Do you have any sort of Snapshot that you can go to that has good/stable drives that you can use as a base for the Restore?

Lee Ryan's picture

Thanks for the reply.

I have a pre-production snapshot with the previous drive configuration, but TKLBAM was not set up on the failed instance - so I'm not sure, could it still help?

The data I want to retrieve is only stored in the failed/missing LVM volume.

I'm getting that sinking feeling...

Jeremy Davis's picture

But for future reference I would never do low level system tasks on a HDD unless you have a backup first (or don't care if you lose the data...) Although really you should always have a recent backup (or 3) of important data.

I'm only guessing but it sounds to me like sda1 is your /boot partition, sda2 is probably your original LVM turnkey-root and sda6 is the new extended partion (which resides within sda5).

Personally, first thing I'd be doing is loading your system with a live CD/ISO and image it (use dd but make sure that you get the input and output files around the right way... if you dd a blank image file over your HDD you will wipe it completely...). Then use pvscan, vgscan and lvscan to see what is going on and see if you can recover the LV. Possibly worth running fsck on the partitions too. Beyond that, there are some Linux commandline partition recovery tools which may be worth trying out (I don't recall the names, but I'm sure google will help you out there. You may also be able to try recovering the data from the LVM using file recovery tools, but I've had no success doing that in the past if the LV itself can't be found.

Bottom line is though, unless your snapshot contains the data you want back, it is quite possible that this may be a harsh lesson in the importance of backups. Remember data loss due to hardware or software malfunction is a matter of when - not if...

[update] Just came across this post in another thread. Might be worth a try??

Post new comment