Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Mounting LVM on boot?!
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Guest






PostPosted: Mon Apr 29, 2002 7:59 pm    Post subject: Mounting LVM on boot?! Reply with quote

I am currently "converting" my partition to LVM. Backuped all files to another parition, created the volume group and logical volume and copied all files back. The big question now is though ... how do I mount the LVM on system boot?

The old config looked like this
/dev/hda1 ext3 /boot
/dev/hda2 swap none
/dev/hda3 ext3 /

hda is now a LVM drive (reiserfs) with all the root files on it... The volume group is called vg01, the logical volume lv01 so I can mount the hd with /dev/vg01/lv01 in the rescue system.
LVM support is compiled into the kernel but what options do I have to set in grub/menu.lst for example? I tried kernel /boot/bzImage root=/dev/vg01/lv01 but that gives a kernel panic, "can not mount root file system".


I am not a guest btw ... I have an account but I am using another computer at the moment... :(
Back to top
Guest






PostPosted: Mon Apr 29, 2002 8:01 pm    Post subject: Reply with quote

Uhm, it should be:
hda3 is now LVM drive ...

sorry for the typo
Back to top
Nitro
Bodhisattva
Bodhisattva


Joined: 08 Apr 2002
Posts: 661
Location: San Francisco

PostPosted: Mon Apr 29, 2002 9:16 pm    Post subject: Reply with quote

I just rebuilt my box and am running LVM + XFS + Reiserfs, and all seems fine. On my box I created a root partition of using XFS and it occupies about 200 MB. My partition table:
Code:
   Device Boot    Start       End    Blocks   Id  System
/dev/hda1             1         6     48163+  83  Linux
/dev/hda2             7        32    208845   83  Linux
/dev/hda3            33      1435  11269597+  8e  Linux LVM
/dev/hda4   *      1436      2482   8410027+   7  HPFS/NTFS


You have to initalize your LVM VG's (virtual groups) in order to use them, mine are enabled using the boot scripts. So, this leads us to our solution (one I haven't tried, yet): create an initrd. I'm not 100% sure about how you'd do this, but takea peak at the man page for
'lvmcreate_initrd'. After you make a ramdisk you need to tell your kernel to load the ramdisk, which you should probably put on a /boot partition or something. Again, I'm not sure how to use the initrd yet, I wanted to mess with LVM a little before plunging face first in to it.

I would be very interested in hearing if/how you get this to work.
_________________
- Kyle Manna

Please, please SEARCH before posting.

There are three kinds of people in the world: those who can count, and those who can't.
Back to top
View user's profile Send private message
Guest






PostPosted: Tue Apr 30, 2002 6:46 am    Post subject: Mounting LVM on boot Reply with quote

I actually was able to get LVM as my root directory with little effort.
In my case what i did I created a small 20MB partition as the boot partition. Here's an example of my current partition table with LVM.


Filesystem 1K-blocks Used Available Use% Mounted on
/dev/serverdrive/lvol1
7639928 1901224 5350608 27% /
/dev/hda1 23302 3516 18583 16% /boot

I ran this command after i got the boot partition set up with all the kernel files and grub

lvmcreate_initrd 2.4.19-gentoo

(2.4.19-gentoo is the name of the kernel I'm using yours might be different)

it will place the file initrd-lvm-2.4.19-gentoo.gz in your /boot directory

in my menu.lst file this is what i put down:

default 0
timeout 1
splashimage=(hd0,0)/boot/grub/splash.xpm.gz

title=Gentoo Linux on Marius
root (hd0,0)
kernel /boot/bzImage apm=on apm=power-off
initrd /boot/initrd-lvm-2.4.19-gentoo.gz


the lines in bold minus the apm stuff is what you need to put into grub to get it to work without any problems

don't worry about specifing root=/dev/whatever the ramdisk loads the LVM volume for you.

I hope I made some kind of sense :)


Mario
tekwolfnyc@latinwolf.com
Back to top
Guest






PostPosted: Tue Apr 30, 2002 2:44 pm    Post subject: Reply with quote

So far so good... initrd created, grub modified.
I can not read if the initrd is successfully loaded, the messages are scrolling to fast and I can't pause them with the pause key :( I also cannot scroll up...
Now when the kernel tries to mount the root partition it says it cannot find a reiserfs partition?! :cry:

My root LVM parition is /dev/vg/root with reiserfs.
How does the initrd "know" what my root partition is if I don't define it in grub or somewhere?
Back to top
Guest






PostPosted: Tue Apr 30, 2002 3:37 pm    Post subject: Reply with quote

I think I know what the problem is. The kernel does not decompress the initrd image :( It says "RAMDISK: compressed image found at 0" but the next line is "freeing initrd..."

Huhm?!
Back to top
mossmann
n00b
n00b


Joined: 23 Apr 2002
Posts: 13

PostPosted: Tue Apr 30, 2002 4:01 pm    Post subject: Reply with quote

Is your kernel compiled with:

CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_INITRD=y

?
Back to top
View user's profile Send private message
Guest






PostPosted: Tue Apr 30, 2002 4:16 pm    Post subject: Reply with quote

Yes, it is.
Back to top
tekwolfnyc
n00b
n00b


Joined: 30 Apr 2002
Posts: 6

PostPosted: Tue Apr 30, 2002 6:30 pm    Post subject: Reply with quote

Did you build reiserfs support into the kernel instead of a module

I know I know but it doesn't hurt to ask :)


Mario
Back to top
View user's profile Send private message
Guest






PostPosted: Tue Apr 30, 2002 6:37 pm    Post subject: Reply with quote

Yep, reiserfs is also compiled into the kernel. And before you ask, LVM is also compiled into the kernel ;)
Back to top
tekwolfnyc
n00b
n00b


Joined: 30 Apr 2002
Posts: 6

PostPosted: Wed May 01, 2002 3:41 am    Post subject: Reply with quote

Is the kernel booting up at all would be the next question

if so is this line in your /etc/fstab

tmpfs /dev/shm tmpfs defaults $



CONFIG_DEVFS_FS=y
CONFIG_DEVFS_MOUNT=y

make sure these are enabled too gentoo wigged out on my about those two options.

Since I set up my LVM with ext3 i guess my case might be different but it shouldn't be. In anycase maybe the above might help.


Mario
Back to top
View user's profile Send private message
sven
Apprentice
Apprentice


Joined: 19 Apr 2002
Posts: 274

PostPosted: Wed May 01, 2002 11:38 am    Post subject: Reply with quote

This was me all the time. I gave up on LVM. I am using normal reiserfs again.
The kernel did not decompress the initrd image though it did found an image in the ram. ram disk and initrd support was compiled into the kernel.
Back to top
View user's profile Send private message
arkane
l33t
l33t


Joined: 30 Apr 2002
Posts: 918
Location: Phoenix, AZ

PostPosted: Fri May 10, 2002 10:50 pm    Post subject: Reply with quote

sven wrote:
This was me all the time. I gave up on LVM. I am using normal reiserfs again.
The kernel did not decompress the initrd image though it did found an image in the ram. ram disk and initrd support was compiled into the kernel.


Well if you ever try again, there is a howto on LVM now....

--
Dan
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware 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