separate /home /usr/local partitions... how?


Forum: HD Install
Topic: separate /home /usr/local partitions... how?
started by: prayforwind

Posted by prayforwind on Oct. 22 2004,17:58
I want to install DSL with separate /home and /usr/local and /opt partitions spread out over 2 drives, or be able to move these  partitions to another drive after installalation. Can this be done, and how? If I move them manually and update /etc/fstab accordingly, everything works... until I reboot and "KNOPPIX" adds those partitions to /etc/fstab again. (seems it rebuilds /etc/fstab each boot... can I inhibit this and make my own changes to /etc/fstab permanent? I -think- that's all it would take, no?)
Posted by AwPhuch on Oct. 22 2004,19:34
Im not sure if the stock install will allow this, but there is a solution!!

1.  do a HD install on say /dev/hda1
2.  reboot using the cd version
3.  Mound /dev/hdb and /dev/hda1
4.  using cfdisk create whatever size partitions with their labels /home and /usr/local and /opt to whatever size you choose...remember to format them
5.  mount /dev/hda1 and do a
Code Sample
cp -f /mnt/hda1/home /mnt/hdb1/home
cp -f /mnt/hda1/usr/local /mnt/hdb2/usr/local
cp -f /mnt/hda1/opt /mnt/hdb3/opt
remember to go into the /mnt/hda1 and rm -rf /home
rm -rf /usr/local
rm -rf /opt before rebooting


you could also pre-edit your /mnt/hda1/etc/fstab with the new partition info as well

Backup anything you dont want to loose b4 you try this method..

When DSL reboots it should automatically see the /dev/hdb partitions labeled as above and use them just as if they were already there

Brian
AwPhuch

Posted by prayforwind on Oct. 27 2004,14:26
Thanks Brian,

That's pretty much what I did, and it all works just fine... until reboot when /etc/fstab get's re-written. Example: I mount /hdb6 and move /home to it, edit fstab, works fine (/home now on /dev/hda6 and I can mount/umount /home just fine). Next boot fails because /home expected to be on root fs, I have to re-edit /etc/fstab (to remove /hda6 /dev/hda6 and add /home /hda6). Something's re-writing /etc/fstab each boot, I want to stop it. Any hints?

Posted by AwPhuch on Oct. 27 2004,16:48
did you label those partitions when you formatted them??

It might just see a blank ext2 and not assocaite the parititon with /home

Im checking now...might be the KNOPPIX autoscript you could edit..

Did you modify /etc/fstab above or below the line
# partitions found by dsl


Brian
AwPhuch

Posted by AwPhuch on Oct. 27 2004,17:20
ok the /etc/init.d/knoppix-autoconfig finds extra partitions by using /proc/partitions info...

I think it truncates anything after the #partitions found by dsl part in /etc/fstab

Otherwise you might have to mke2fs those partitions and label them accordingly

Code Sample
e2label /dev/hda3 /work


however its going to be a bit tricky since you already have those filenames and whatnot in your / dir....

Posted by AwPhuch on Oct. 27 2004,17:26
Ok new method

If those partitions are still active and alive (unmouted!!)
1.  Label the parition you want like
Code Sample
e2label /dev/hdb1 /home
e2label /dev/hdb2 /usr/local
e2label /dev/hdb3 /opt


Then mount /dev/hdb1 and cd into /home and cp * /mnt/hdb1
and so on and so forth
then rename /home and other moved dir to /home1
then mkdir dir /home and edit fstab  

reference < http://www.redhat.com/docs....rt.html >

Brian
AwPhuch

Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.