View Single Post
Old 14th July 2011, 15:34
anw anw is offline
Join Date: Feb 2007
Posts: 53
Thanks: 0
Thanked 6 Times in 6 Posts
Default grub.cfg & Restructuring Partitions

I just installed Debian on a brand new machine with a Revo SSD drive, and laid out these partitions:

lvm partition with root on it (usr, etc. are on a hard drive)

My old Linux system had a boot partition of 32M, and, with a couple of kernels, was only half full. I started out with squeeze, then decided I wanted to go ahead and put sid on it, and don't have enough room in /boot (/ is on the lvm section).

So, since I have 12G of RAM, I allocated 12G of swap, but I doubt I'll need that much. I could just increase the boot partition into the swap for enough room (booting from my install cdrom as the "live" cd), but I'd rather have /boot on the logical volume anyway, and therein lies my problem.

I spent 2-3 days decoding lvm root on the SSD raid drive before I actually had a bootable system. I'm under the impression that /boot can be on an lvm logical volume, but this is how I finally got to a bootable state. Now, instead of reinstalling everything, I'm wondering if I can just get a boot directory on my root lvm, copy everything from the "hard" boot partition into it, and reboot.

Here's an excerpt (for one kernel) from my grub.cfg file:
menuentry 'Debian GNU/Linux, with Linux 2.6.32-5-amd64' --class debian --class gnu-linux --class gnu --class os {
	insmod gzio
	insmod part_msdos
	insmod ext2
	set root='(hd3,msdos1)'
	search --no-floppy --fs-uuid --set=root 7af19f51-2091-44b6-919a-cd4292f504e1
	echo	'Loading Linux 2.6.32-5-amd64 ...'
	linux	/vmlinuz-2.6.32-5-amd64 root=/dev/mapper/revo_vg-root_lv ro  quiet
	echo	'Loading initial ramdisk ...'
	initrd	/initrd.img-2.6.32-5-amd64
Here's the file:
(hd0)	/dev/disk/by-id/ata-OCZ-REVODRIVE_OCZ-3655QYX858580954
(hd1)	/dev/disk/by-id/ata-OCZ-REVODRIVE_OCZ-D164YAY66KI1B500
(hd2)	/dev/disk/by-id/ata-SAMSUNG_HD204UI_S2H7JD1ZB03056
(hd3)	/dev/mapper/sil_bgbhagahddai
Here's the /dev/disk/by-id directory (hd1 isn't used in the grub.cfg file):
ata-OCZ-REVODRIVE_OCZ-3655QYX858580954 -> ../../sda
ata-OCZ-REVODRIVE_OCZ-D164YAY66KI1B500 -> ../../sdb
And here's my /dev/mapper directory:
revo_vg-root_lv -> ../dm-4
sil_bgbhagahddai -> ../dm-0
sil_bgbhagahddai1 -> ../dm-1
sil_bgbhagahddai2 -> ../dm-2
sil_bgbhagahddai3 -> ../dm-3
The sil_bgbhagahddai refers to the aggregated RAID array of two "disks" (SSDs).

So, is it remotely possible to believe that I can make a boot2 directory in the SSD root logical volume and make these changes in
(hd0)	/dev/disk/by-id/ata-OCZ-REVODRIVE_OCZ-3655QYX858580954
(hd1)	/dev/disk/by-id/ata-OCZ-REVODRIVE_OCZ-D164YAY66KI1B500
(hd2)	/dev/mapper/sil_bgbhagahddai3 # third partition on the SSD
(hd3)	/dev/mapper/sil_bgbhagahddai
And these conceptual changes in grub.cfg:
insmod part_msdos
insmod ext2
set root='(hd2,msdos1)' # or, maybe, '(hd2,msdos1)/boot2'?
			   # or, maybe just '(hd2)', or (hd3,3), etc.??
and believe this will boot? I really want to have my /boot directory in a LV on the SSD so I'll never have to worry about this running-out-of-space thing again.

If this will even work in principle, the msdos1 is a show-stopper, since that's a reference to a "hard" partition instead of an lvm volume, but I don't know what to replace it with or how to reference it, unless it is one of the choices in my "conceptual grub" comments.

I've been through the grub2 documentation, and, so far, haven't even seen the "msdos1" flag documented.

Is there a grub/lvm/RAID/SSD expert out there somewhere?

Reply With Quote
Sponsored Links