Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved]LVM: all under LVM - initrd needed/GRUB config?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
lyallp
Veteran
Veteran


Joined: 15 Jul 2004
Posts: 1409
Location: Adelaide/Australia

PostPosted: Fri Aug 03, 2007 2:02 am    Post subject: [Solved]LVM: all under LVM - initrd needed/GRUB config? Reply with quote

There are a couple of questions in this post, I provide a fair bit of background.
Cutting to the chase, the questions are...

Can I simply boot the kernel in /boot and everything will work? Or, do I need to go through the whole rigmarole of creating an init ram disk?

My other question is that GRUB previously had something like hd0=hda, hd1=hdb, hd2=hdd, in the /boot/grub/device.map - do I simply add a new hd3=sda ?


The following is background for the above 2 questions.

I have a gentoo system that has been quietly minding it's own business for about 3 years now.
I use GRUB to boot linux on my primary IDE Master.
Windows XP is on the primary IDE slave
GRUB transposes these two disks when I want to boot Windows.

The primary IDE Master (ie, Gentoo) hard drive it is on is getting old and starting to fail. So, I went out and bought myself a spanking new 500G SATA drive.

After rebuilding my kernel to enable SATA and device mapper, things start looking sweet.

My current install is using XFS as native partitions on the disk - which has been a problem because I have wanted to increase the size of /tmp and was unable to.
My New disk shows up as /dev/sda rather than my usual IDE drives which show as /dev/hd[abd]

I partitioned the new disk as (primary paritions, I had no need of more than 3 so extended partitions was a waste of time)
1=32mb/type linux
2=100G/type LVM
3=the rest/type Win95 FAT32

Partition 1 is my /boot partition
I setup as LVM on partition 2 and created logical volumes for each of my existing partitions, including a swap volume.

Each logical volume was then formatted as XFS, except for a swap volume.

The /boot partition was also formatted as XFS.

Partition 3 is the remainder as a FAT32 filesystem (so I can easily share between it and a dual booting Windows XP on this machine, but on a separate disk) I may change this to NTFS as I have ntfs-3g installed but am still slightly nervous about some of those corner cases they talk about.

I mounted all these new partitions under a mount point /mnt/new (except the swap partition :-) )

I copied each filesystem over to the LVM mounted filesystems using tar (to preserve symlinks, etc).
I tweaked the /mnt/new/etc/fstab
I tweaked the /mnt/boot/grub/grub.conf
I even tweaked /boot/grub/grub.conf to test booting the new disk (once I confirm it boots, I will direct the BIOS to actually boot that disk, not my aging existing disk)

Now, comes the fun part.
I want to have root (/) as LVM controlled, not a native partition.

My Kernel has XFS and LVM and device mapper built directly into the kernel, not as modules.

I know various docs talk about the initrd but I was wondering whether it is still necessary.

In order to use the initrd, I have built in ext2 filesystem (not as a module), which, previously, I did not have enabled at all.
_________________
...Lyall


Last edited by lyallp on Fri Aug 03, 2007 1:04 pm; edited 1 time in total
Back to top
View user's profile Send private message
likewhoa
l33t
l33t


Joined: 04 Oct 2006
Posts: 778
Location: Brooklyn, New York

PostPosted: Fri Aug 03, 2007 7:28 am    Post subject: Reply with quote

lyallp wrote:
Can I simply boot the kernel in /boot and everything will work? Or, do I need to go through the whole rigmarole of creating an init ram disk?

since you have created a LVM physical volume out of the hd0,1 partition, you will have to create and initrd which will activate your logical volumes in order to mount / and the rest of the logical volumes set up on it with lvcreate.

lyallp wrote:
My other question is that GRUB previously had something like hd0=hda, hd1=hdb, hd2=hdd, in the /boot/grub/device.map - do I simply add a new hd3=sda ?


you're gonna have to setup grub again on the new drive so that grub can be installed in the mbr.

my suggestion to avoid setting up a initrd to activate the logical volumes would be to setup a partition scheme like so:

/dev/sda1 /boot -> size 32MB
/dev/sda2 / -> size 1GB
/dev/sda3 lvm physical volume -> size 20GB or however much you want to allocate.
/dev/sda FAT32 -> size 1K because that's all windows deserves :D

then when you create your LVM2 physical volume, create logical volumes for:

/var
/var/tmp
/usr
/usr/portage
/usr/portage/distfiles
/opt
/home
/tmp

/dev/sda2 will hold the needed "/" directories for a boot without the need to execute "lvchange -ay <lv-name>" command.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum