How to set /home to another partition
Forum: Other Help Topics
Topic: How to set /home to another partition
started by: Tommy599
Posted by Tommy599 on July 23 2008,16:05Hey everyone!
I searched the forum for this but couldn't find anything, maybe it's called something different, sorry if the is a topic on this on already.
I installed the latest DSL, 4.4.3 on my Toshiba Satellite Pro 4200 500MHz, 128MB RAM, 20GB HDD using HD-install.
I would like to have the /home folder on a different partition (mounted to a different partition, don't know the exact terminology. ) so when I upgrade or change distros my data doesn't get lost.
Yes, I know there is a backup service but I usually keep alot of things in my home folder and it takes a long time for the initial backup. ( I had some problems with this, I loaded the home folder with pics and then I thought DSL froze when I tried to turn off the laptop, when in fact it was backing up the data).
So, can this be done and how?
Posted by Juanito on July 23 2008,16:21What you're looking for is called persistent home - you can find the explanation of what to do in the dsl wiki.
If your files are reasonably static, why not save them on the other partition rather than in /home/dsl?
Posted by Tommy599 on July 23 2008,16:48That's it! Thanks!
That would be an option too, but I'm too lazy to always copy stuff to the other partition. This way, I just copy stuff to $HOME and it's easier. It's more convenient for me this way
Posted by mikshaw on July 23 2008,22:15I agree with you. Static files are best stored, in my opinion, in a persistent home, as long as you don't have a need to use multiple machines. Personally I even keep other files such as root's personal configs, bootlocal, and other files I want to persist in a subdirectory of /home/dsl (with proper file ownership) and copy or link them into the system because I find it more logical to do that than to rewrite a backup file every time I reboot.
Posted by Tommy599 on July 24 2008,16:27Well I followed all the instructions, but I am not sure I managed to do what I wanted.
hda4 is the partition I want home to be. I created a folder named home there. Modified fstab and bootlocal.sh, added the home=hda4 and nofstab to the appen line in lilo.conf.
hda4 is mounted at boot, and I see it unmounting at shutdown but if I put a file in my home directory it doesn't show up in /mnt/hda4/home/dsl. What did I do wrong?
Here's my /etc/fstab:
And my /opt/bootlocal.sh:
Posted by curaga on July 24 2008,16:41Perhaps you stepped over the automatics, since you wouldn't have needed to edit fstab or bootlocal, or even create the directory..
Posted by ^thehatsrule^ on July 24 2008,18:20You either use home= OR you use nofstab with and manually edited /etc/fstab. That's an exclusive or.
In any case, your /etc/fstab was modified wrong: /dev/hda4 points to /mnt/hda4
It'll probably just be easier to use the automatic home= cheatcode. For more information, there's an article in the wiki on persistence.
Posted by Tommy599 on July 25 2008,12:01Yes, I read the wiki article.
I tried it as it said, but torsmo shows the same values for / and /home filesystem so I don't think it's worked. And the partitions aren't the same size.
Could it be a problem that lilo is on another partition, with Vector Linux Light? So I did this in DSL:
mkdir -p /mnt/hda4/home
cp -a /home/dsl /mnt/hda4/home
Then booted in Vector, modified the lilo.conf (added the home=hda4) , ran lilo and then booted in DSL but no change....
Posted by lucky13 on July 25 2008,15:46Not /mnt/hda4/home/... because the root of /mnt/hda4 is being mounted as /home. The directory for dsl needs to be in hda4's root. The way you're doing it is /mnt/hda4/home/home/dsl.
When I move stuff to new partitions like that:
(enter root password)
# cp -rp dsl/ /mnt/hda4
Now when /home is mounted on /dev/hda4, ./dsl is in /home (edit: with all the original permissions preserved). Not in /home/home.
Posted by Tommy599 on July 26 2008,08:46But this is what the wiki says:
So what should I do now? I did a clean install of DSL 4.4.3 on hda2. I want my home to be on hda4. What's the right method of the 2?
Posted by lucky13 on July 26 2008,12:46
If you're reinstalling, why not do a frugal install and use DSL as it's intended?
Posted by ^thehatsrule^ on July 26 2008,19:23Ah, didn't notice he didn't do a frugal. Perhaps the cheatcode only works for it.
If you plan on keeping your current setup (and that the cheatcode doesn't work), using the traditional method of editing /etc/fstab should work, provided that you use /home this time (and lucky13's first suggestion I suppose).
Posted by lucky13 on July 26 2008,19:56I haven't tried the grub cheatcode for traditional install simply because persistent partition(s) in frugal installs can share the same partition for /home and /opt and so it includes the /home designation on that partition -- so it's not quite the same as mounting a partition as /home. DSL is a live CD, not traditional Debian installer (see below). Users who want a traditional hard drive install have to weigh the "quirks" related to un-knoppix'ing and un-DSL'ing a CD-based distro or just living with it on one partition and with some odd behavior that carries over from the engineering required to run Debian (edit: in the forms of Knoppix or DSL) from a live CD.
Just remember (or be warned!) to put any new persistent partitions above all that "added by knoppix" crap in fstab because knoppix owns and rewrites all of those lines and below them in often odd, unpredictable, capricious ways. Which gets me back to something I've come to think is sound advice: if you want a Debian-like system, install Debian; if you want DSL, use it as it's designed -- which means as a live CD or frugal-installed system.
Posted by Tommy599 on July 27 2008,14:05I give up, I'm staying with the default HD-install.