Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Root LVM
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
steeledan
n00b
n00b


Joined: 18 Jul 2004
Posts: 8

PostPosted: Thu Jan 13, 2005 5:27 pm    Post subject: Root LVM Reply with quote

Code:

Assuming you already have all your lvm's set up and everything (boot is still ext2, lvm in kernel...)

You'll need to create this directory structure under /boot

/bin
/dev
/etc
/etc/lvm/
/etc/lvm/archive
/etc/lvm/backup
/lib
/mnt
/mnt/cdrom
/mnt/root
/proc
/sbin
/var
/var/lock
/var/lock/lvm


You'll need to copy files to /boot/bin:

bash  cat  chroot  ls  mount  sh  umount


You'll need copy files to /boot/sbin

pivot_root  vgchange  vgscan


You'll need all the libs used by the bins listed above - type ldd <filename> to find them.  I used these:

ld-linux.so.2  libattr.so.1   libc.so.6             libdl.so.2       libpthread.so.0  libuuid.so.1
libacl.so.1    libblkid.so.1  libdevmapper.so.1.00  libncurses.so.5  librt.so.1


create /boot/etc/fstab like this:

/dev/hda1               /               ext2            noatime         0 0
/dev/vg/root            /mnt/root       reiserfs        ro              0 0
none                    /dev            devfs           defaults        0 0
none                    /proc           proc            defaults        0 0


create /boot/sbin/init like this (chmod 700):

#!/bin/sh
/bin/mount /proc -n
/sbin/vgscan --ignorelockingfailure
/sbin/vgchange -ay --ignorelockingfailure
/bin/mount /mnt/root -n
cd /mnt/root
/sbin/pivot_root . ./boot
/bin/mount /dev
exec /bin/chroot . /bin/sh -c "/bin/umount /boot/dev -n;/bin/umount /boot/proc -n;/bin/umount /boot -n;exec /sbin/init" </dev/console >/dev/console 2>&1


create /boot/etc/lvm/lvm.conf like this:

devices { filter=["r/cdrom/"] }


Your real /etc/fstab should look something like this (don't forget devfs):

none                    /dev            devfs           defaults                0 0
/dev/hda1               /boot           ext2            noauto,noatime          1 1
/dev/vg/root            /               reiserfs        noatime,notail          0 0
/dev/vg/usr             /usr            reiserfs        noatime,notail          0 0
/dev/vg/var             /var            reiserfs        noatime,notail          0 0
/dev/vg/opt             /opt            reiserfs        noatime,notail          0 0
/dev/vg/tmp             /tmp            reiserfs        noatime,notail          0 0
/dev/vg/home            /home           reiserfs        noatime,notail          0 0
/dev/hda2               none            swap            sw                      0 0
/dev/cdroms/cdrom0      /mnt/cdrom      iso9660         noauto,ro               0 0
none                    /proc           proc            defaults                0 0
none                    /dev/shm        tmpfs           defaults                0 0

Then change grub/lilo to root=/dev/hda1 and reboot

You'll want a rescue cd just incase something goes wrong, or if I forgot something :)  If having trouble, set init=/bin/sh in grub/lilo and try entering commands from /boot/sbin/init
[/code]
Back to top
View user's profile Send private message
blake121666
Tux's lil' helper
Tux's lil' helper


Joined: 21 Apr 2004
Posts: 75
Location: Catonsville, MD

PostPosted: Sun Jan 16, 2005 2:45 am    Post subject: Reply with quote

Just use an initrd and put it on your /boot partition with all of that stuff. You can always "mount -o loop" it to change anything. You could even keep it compressed.
_________________
--Blake
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks 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