How do I migrate an existing standard install of debian with grub to LVM
Just to clarify something ahead of time, I'm running a liveusb of mint 17 to do all this, that's just what I had lying around to work with.
More clarification, I am stuck at getting grub to work. Everything is back in place, but I can't get grub to work beyond showing the menu. When I hit enter on the selection for my drive, i get this. I've already tried the following links, and they didn't help me: http://ubuntuforums.org/showthread.php?t=1347375 http://manpages.ubuntu.com/manpages/...te-grub.8.html https://wiki.archlinux.org/index.php/GRUB#LVM http://wiki.gentoo.org/wiki/LVM[/QUOTE] I had disk orginally set up with separate /boot, /, and /home partitions for debian, with another / for mint which would share the /boot and /home partitions. I've backed up everything to an external hdd, wiped my drive and made an LVM partiton, and created the volume group, and subsequent logical volumes, and rsync'd everything back. I then chrooted in to the debian root (with everything mounted of course) and that's where any and all guides I could find failed me. I tried all the typical grub-install things one would do to reinstall from chroot, but it didn't work. I was able to run "grub-install --recheck /dev/sda" and "update-grub" one of which updated my grub.cfg to include "insmod lvm" and the proper lv labels where required. So I edited my fstab to include the proper uuids for each lv. It booted to the correct grub menu and I was thrilled, but when I selected the firat option it didn't go thru (I'll update with pictures of error). I can't find anything anywhere to help me with this, so could anyone here tell me what is the proper way to install grub on an lvm and get it running correctly? Please and thanks! Forgot to include my vg and lv setup. See below: Code:
vgdisplay |
"migrate an existing standard install of debian to LVM"
Copy or clone off and then create as you like and clone or copy back is a usual way. It may be possible to do the old shuffle trick where you create some small lvm and then move files a few at a time and then resize and move more and eventually it's all moved and you delete original. I don't know of a way to create in place. Might be. |
Ok, it's migrated, but the issue is with getting grub working with this too. I can't figure out how to get grub to update with this new layout. That's my roadblock.
|
http://ubuntuforums.org/showthread.php?t=1347375
http://manpages.ubuntu.com/manpages/...te-grub.8.html may be most easy way. This assumes you have a current enough grub that has support for all the devices and file systems. Some tips in here. https://wiki.archlinux.org/index.php/GRUB#LVM Better see this too. http://wiki.gentoo.org/wiki/LVM |
Quote:
Ubuntu forum thread - there is no "grub" command for me to use. Arch Wiki & update-grub - I used update-grub and it changed the entries to be what the arch wiki suggests, but it won't boot with that. As mentioned in OP, the grub menu is generated properly, but it can't or won't boot the entry. Gentoo wiki - nothing in there about using lvm with grub. |
I double checked that error message I get when I try to boot up one of the menu entries. It says that "/dev/mapper/vgfirstdisk-lvdebroot" doesn't exist, so I went and double checked and it surely does, pointing right at /dev/dm-1. For some reason this just isn't being seen by grub or something, so I'm going to try setting "set root='(vgfirstdisk-lvdebroot)'" and all similar entries directly to dm-1, or dm-0 for lvboot. Will update with results.
|
Turns out the issue wasn't grub at all. Or maybe it still is, I'm not sure. When it failed to find vgfirstdisk-lvdebroot it dropped me to an ash shell. From there I was able to look around the filesystem that was available to me. There was no entry in /dev for dm-*, no volume group, no logical volumes. Nothing showed up. Well, more specifically none of my lvm stuff showed up. So my guess is that (maybe, I'm probably wrong here) something with init isn't starting the way it should in order to pull up, recognize, and use the vg or lv that I have.
Any thoughts or suggestions would be more than welcome. |
If you got to ash grub has done its job. Check the initrd/initramfs has all the necessary support.
|
Quote:
|
Oh, my. Sorry. I was of no help here at all.
|
Best would be to chroot into the LVM Debian, then simply run whatever Debian use to generate the initramfs. It should pull in all the required modules for the current environment, including LVM.
I'd reckon "update-initramfs -u" should update the current initramfs image, but I don't use Debian. this is the handbook for another option. They also have a wiki. |
Ok, i was thinking that would be the command needed but didn't know enough about it. When i get home I'll update with results.
|
No go. I prepared the chroot as follows:
Code:
mount /dev/vgfirstdisk/lvdebroot /mnt Code:
root@mint:/# dpkg-reconfigure linux-image-3.2.0-4-amd64 Just to clarify, the mentions of the 3.13 kernel in the above code snippiet are just from an experiment I was running to build a kernel module for an external system. Has no affect on this at all as the kernel isn't actually setup to run on this system at all, and wasn't interferring with the system before anyway. So I tried this: Code:
root@mint:/# update-initramfs -u I don't know if this means anything, but I have my external plugged in this whole time too and it'll complain about I/O errors for /dev/sdc or something like that before dropping to the ash shell. I tried unplugging it, but it doesn't make a difference. So, now that this avenue has been explored, what do I try next? |
I'm thinking I either didn't do something right when updating the initrd, or something else needs updating. Any input would be greatly appreicated as I have hit a wall here and don't know where to go to continue.
|
UPDATE! I got something to actually boot. So I was trying to copy over my old system to this new LVM setup, then I was going to install linux mint. Well, I got it copied, but wouldn't boot and figured "Screwit, I'll install mint and see if it fixes anything" which it kinda did. I can boot mint from lvmintroot perfectly. The grub menu now looks nice and clean and has debian listed on lvdebroot. But for some reason debian still doesn't boot correctly. Several things just don't work right anymore. Slim won't start up, bash-completion was wonky so I had to reinstall that, and more. So this tells me that something wasn't copied correctly, or that further reconfiguring is required to get this to work. Problem now is, I don't know what to do next. Any ideas or guidance would be greatly appreciated as always.
|
All times are GMT -5. The time now is 10:00 PM. |