TurnKey Linux Virtual Appliance Library

Repository appliance: device mapper/lvm/initramfs issue

Hi all,

 

 Running TurnKey Repository in a VMWare vCloud environment. I have extended the LVM and expanded the root fs to add some more disk. All of that went according to plan and everything was running fine. After an 'apt-get update' and 'apt-get upgrade', the VM refuses to boot and drops into busybox in the initramfs environment. The error provided is (paraphrased):

ALERT! /dev/disk/by-uuid/<UUID> does not exist.

I fired up lvm from the initramfs and was pleased to see that my disk devices aren't indeed gone or damaged:

(initramfs) lvm
lvm> pvscan
  PV /dev/sda2   VG turnkey   lvm2 [18.14GiB / 0   free]
  PV /dev/sdb    VG turnkey   lvm2 [64.00 GiB / 0  free]
  Total: 2 [82.14 GiB] / in use: 2 [82.14 GiB] in no VG: 0 [0   ]
lvm> vgscan
  Reading all physical volumes.  This may take a while...
  Found volume group "turnkey" using metadata type lvm2
lvm> lvscan
  inactive        '/dev/turnkey/root' [81.64 GiB] inherit
  inactive        '/dev/turnkey/swap_1' [512.00 MiB] inherit

After a quick 'lvchange -ay /dev/turnkey/root' and 'lvchange -ay /dev/turnket/swap_1' I was able to exit the initramfs and the machine booted fine.

My first thought was that something went wrong with regenerating the initramfs during the upgrade, so I re-ran update-initramfs and it completed (though complained about some casper scripts which seem to not be a problem per some google search results). Still didn't want to boot without human intervention. I figured I'd try a symlinking of /usr/share/initramfs-tools/scripts/ to /scripts which seemed to make things happier when update-initramfs was run. Still no luck on a reboot though.

The problem is clearly something with lvm/device mapper in the initramfs, but I thought it best to see if anybody else had seen/solved this before me rather than keep digging where I may be duplicating somebody else's effort.

Any thoughts or ideas for me?

thanks

This seems to have happened a while after an lvextend, which went fine (including reboots).

After a wild goose chase regarding incorrect UUID's, update-grub, grub-install,  mkdevicemap ... it turned out to be fixed by this.

Many thanks for posting and sharing this.


Some thoughts ;-)

Good start Deker - let me add few details to make your reboot without human intervention.

# Reinit the map and the grub file to avoid the UUID
mv /boot/grub/device.map /boot/grub/device.map.backup
grub-mkdevicemap
update-grub

# You know this part already
cd /
ln -s /usr/share/initramfs-tools/scripts
update-initramfs -u

# Just reload the box

Cheers!

Thanks

Great fix!

Thanks!

THX

Excellent. Thank you. Best article.

Post new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account, used to display your avatar.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <p> <span> <div> <h1> <h2> <h3> <h4> <h5> <h6> <img> <map> <area> <hr> <br> <br /> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <em> <b> <u> <i> <strong> <font> <del> <ins> <sub> <sup> <quote> <blockquote> <pre> <address> <code> <cite> <strike> <caption>

More information about formatting options

Leave this field empty. It's part of a security mechanism.
(Dear spammers: moderators are notified of all new posts. Spam is deleted immediately)