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:05
Hey 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?

Thank you.

Posted by Juanito on July 23 2008,16:21
What 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:48
That'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:15
I 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:27
Well 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:

Code Sample
/dev/hda2  /  ext2  defaults,errors=remount-ro  0  1
proc  /proc  proc  defaults  0  0
/dev/fd0  /mnt/auto/floppy  vfat  defaults,user,noauto,showexec,umask=022  0  0
/dev/cdrom  /mnt/auto/cdrom  iso9660  defaults,ro,user,noexec,noauto  0  0
# Added by KNOPPIX
/dev/sda1 /mnt/sda1 vfat noauto,users,exec,umask=000,uid=1001,gid=50 0 0
# Added by KNOPPIX
/dev/hda1 /mnt/hda1 ext2 noauto,users,exec 0 0
# Added by KNOPPIX
/dev/hda3 none swap defaults 0 0
# Added by KNOPPIX
/dev/hda4 /mnt/hda4 ext2 noauto,users,exec 0 0


And my /opt/bootlocal.sh:

Code Sample
#!/bin/bash
# put other system startup command here
/sbin/syslogd
mount /dev/hda4 /mnt/hda4

Posted by curaga on July 24 2008,16:41
Perhaps 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:20
You 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:01
Yes, 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:

mount /mnt/hda4
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:46
Not /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:
$ su
(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:46
But this is what the wiki says:

Code Sample
Persistent home directory

A persistent home directory means that your entire home directory is written somewhere permanent, rather than constantly re-created at boot. Your home directory is probably where most of your custom settings are anyway, so making this persistent will save most or all of your settings. Here's how:

1) The first step is to create your home directory. Load up DSL as you normally would. Don't use the home boot option. Execute the following. If you want your home directory somewhere other than hda5, replace hda5 with the mount point of your device.

mount /mnt/hda5
mkdir -p /mnt/hda5/home
cp -a /home/dsl /mnt/hda5/home

2) Reboot, and use the boot option:

dsl home=hda5

Use this boot option every time you boot.


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
Quote
So what should I do now?

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:23
Ah, 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:56
I 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:05
I give up, I'm staying with the default HD-install.
Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.