PDA

View Full Version : changing /home directory to another partition



Keyser
01-20-2005, 11:40 PM
i just installed knoppix to my hd. my partitions look like this:

/dev/hda5/ ext3
/dev/hda6/ swap
/dev/hda7/ ext3

my intention was for hda7 to be my /home directory, as i was told it is good to have it seperate from the main linux partition. but knoppix automatically made my home folder in hda5.

how do i go about changing this?

Rumo
01-21-2005, 12:21 AM
First boot with your knoppix-CD, because I don't now how Linux reacts if you move /home while it is running.

Then mount your root-Partition (cd into it) and move /home somewhere else (e.g. /home_save). Now type 'mkdir home', 'mount /dev/hda7 home' and move your directorys from /home_save to /home.

The last step is to edit /etc/fstab and add the following line:

/dev/hda7 /home ext3 defaults 1 2


There are probably easier ways, but I think that this should work.

McGyver
01-26-2005, 02:02 PM
Hi Folks,

just for confirmation:
it is working fine this way also when you booted from hdd and logged on with root because root home is usually not under /home but under /root.

cu
McGyver

Moto_Guzzix
02-05-2005, 09:39 PM
I just went through this myself and I think I found an easier way..I went to the KNOPPIX menu, picked Configure, and chose the option to create a persistent home directory. It prompted me about whether I wanted to use the entire partition I directed it to (to which I said yes - that's what I created it for), it formatted the partition, then it told me it transferred my home directory to that partition. Done.

Is it really that easy? Or am I missing something?

McGyver
02-07-2005, 10:07 AM
that easy with the assumption that there is not already data on that partition! because a format is a one way ticket (o:

cu
Oliver

jhellen
02-14-2005, 10:25 AM
With other distros I have managed to mount my new partitions under /mnt/tmp5 /mnt/tmp6 etc and did a 'cp -r /home /mnt/tmp5'
then I could just edit my fstab like this
/dev/hda5 /home ext3 defaults 1 2

The only problem here was that knoppix seems to make its own fstab every now and then. I'm using Knoppix 3.7 and I haven't yet been able to edit my fstab. Tried to make a decent mountpoint for my usb-storage devices but they disappeared and now they are mounted under /mnt/sda1 etc.

Konqueror also gets stuck every time I click the /mnt/. It's just like it couldn't find anything under /mnt/

This is my fstab
/dev/hda1 / ext3 defaults,errors=remount-ro 0 1
proc /proc proc defaults 0 0
/dev/fd0 /floppy vfat defaults,user,noauto,showexec,umask=022 0 0
usbdevfs /proc/bus/usb usbdevfs defaults 0 0
sysfs /sys sysfs defaults 0 0
/dev/cdrom /mnt/auto/cdrom iso9660 defaults,ro,user,noexec,noauto 0 0
dev/dvd /dvd iso9660 defaults,ro,user,noexec,noauto 0 0
/dev/cdaudio /cdaudio iso9660 defaults,ro,user,noexec,noauto 0 0

# Added by KNOPPIX
/dev/sda1 /mnt/usb_stick vfat noauto,users,exec,umask=000 0 0
# Added by KNOPPIX
/dev/hda2 none swap defaults 0 0
# Added by KNOPPIX
/dev/hda5 /mnt/hda5 ext3 noauto,users,exec 0 0
# Added by KNOPPIX
/dev/hda6 /mnt/hda6 ext3 noauto,users,exec 0 0
# Added by KNOPPIX
/dev/hda7 /mnt/hda7 ext3 noauto,users,exec 0 0

... and I would like to have it like this:

/dev/hda1 / ext3 defaults,errors=remount-ro 0 1
/dev/hda2 none swap defaults 0 0
/dev/hda5 /home ext3 defaults 1 2
/dev/hda6 /tmp ext3 defaults 0 0
/dev/hda7 /A ext3 noauto,users,exec 0 0

proc /proc proc defaults 0 0
usbdevfs /proc/bus/usb usbdevfs defaults 0 0
sysfs /sys sysfs defaults 0 0

/dev/fd0 /floppy vfat defaults,user,noauto,showexec,umask=022 0 0
/dev/cdrom /mnt/cdrom iso9660 defaults,ro,user,noexec,noauto 0 0
/dev/sda1 /mnt/usb_stick vfat noauto,users,exec,umask=000 0 0
#THESE WOULD BE GREAT TO HAVE
/dev/sdb1 /mnt/usb_stick2 vfat noauto,users,exec,umask=000 0 0
/dev/sdc1 /mnt/usb_drive vfat noauto,users,exec,umask=000 0 0
/dev/sdd1 /mnt/mp3_player vfat noauto,users,exec,umask=000 0 0
/dev/sda1 /mnt/cflash_mdrive vfat noauto,users,exec,umask=000 0 0
/dev/sdb1 /mnt/sd_mmc vfat noauto,users,exec,umask=000 0 0
/dev/sdc1 /mnt/mstick vfat noauto,users,exec,umask=000 0 0
/dev/sdd1 /mnt/smedia vfat noauto,users,exec,umask=000 0 0

I would appreciate some help on this matter :P

mr_ed
02-22-2005, 01:48 AM
Still having these problems? Do you get error messages when you edit /etc/fstab?

-- Ed

doclalor
02-24-2005, 05:15 PM
Konqueror also gets stuck every time I click the /mnt/. It's just like it couldn't find anything under /mnt/

I have had the same problem. I think this is related, too: writing to a mostly-empty 170 GB hda4 partition from a Windows machine using Samba, I get a "disk full" message! As I'm transferring files, I check the used 1-MB blocks on the partitions using #df -m ... and AS I'M transferring files to HDA4, the number of 1-MB blocks used ON HDA1 increases!!! Either #df is not reporting correctly, or /mnt/hda4 is really mapped to hda1!

Here are the relevant lines from my fstab at present:

/dev/hda1 / ext3 defaults,errors=remount-ro 0 1
/dev/hda2 none swap defaults 0 0
/dev/hda3 /mnt/hda3 ext3 noauto,users,exec 0 0
/dev/hda4 /mnt/hda4 ext3 noauto,users,exec 0 0

The drive is a 200 GB Western Digital.

radnor
03-18-2005, 03:39 PM
Still having these problems? Do you get error messages when you edit /etc/fstab?

-- Ed


Mr. Ed,

I can get around the editing problem of the FSTAB file. My problem is ... when I reboot, knoppix REBUILDS the file removing my changes. This is a PIA!

Radnor

numb
03-20-2005, 06:18 PM
I am also attempting to move my home directory to a different partition. I'm able to successfully fix fstab. But, the original home directory won't die. I delete and it regenerates the home directory on the next boot. So, I'm left with two home directories with identiical files and thus the same problem. If I delete a user's folder from the original home directory, then it deletes from the new home directory also (on a seperate partition). Is there a knoppix configuration I've missed?

fingers99
03-20-2005, 08:24 PM
Still having these problems? Do you get error messages when you edit /etc/fstab?

-- Ed


Mr. Ed,

I can get around the editing problem of the FSTAB file. My problem is ... when I reboot, knoppix REBUILDS the file removing my changes. This is a PIA!

Radnor

I found myself having these problem in a HD install of 3.6 until I put my entry before the "made by knoppix" line:

like this:

# /etc/fstab: filesystem table.
#
# filesystem mountpoint type options dump pass
/dev/hdc1 / ext3 defaults,errors=remount-ro 0 1

proc /proc proc defaults 0 0
/dev/fd0 /floppy vfat defaults,user,noauto,showexec,umask=022 0 0
usbdevfs /proc/bus/usb usbdevfs defaults 0 0
sysfs /sys sysfs defaults 0 0
/dev/cdrom /cdrom iso9660 defaults,ro,user,noexec,noauto 0 0
/dev/dvd /dvd iso9660 defaults,ro,user,noexec,noauto 0 0
/dev/cdaudio /cdaudio iso9660 defaults,ro,user,noexec,noauto 0 0
/dev/hdc3 /home ext3 auto,exec 0 0
/dev/hda /mnt/mp3 ext3 auto 0 0
# Added by KNOPPIX
/dev/hdc2 none swap defaults 0 0
# Added by KNOPPIX
/dev/hdd1 /mnt/hdd1 ext2 noauto,users,exec 0 0
# Added by KNOPPIX
/dev/hdd2 none swap defaults 0 0
# Added by KNOPPIX
/dev/hdd3 /mnt/hdd3 ext3 noauto,users,exec 0 0

If you're going to do this and a "mount -a" you need to # out the entry made by Knoppix.

My understanding is that the /etc/fstab entries will be re-written by Knoppix if it doesn't find an entry before the # Added by KNOPPIX.

jmort
03-20-2005, 10:18 PM
This is just a thought, but would saving your configuration possibly save changes to the fstab file. I have seemed to have success by editing my fstab onn a PMI install so that I could make my hda2 partition vfat wriiteable on bootup. I'm not sure whether it was from saving my confiiguration or because the persisitent home is located on that partition. In either case, that is something we might try (saving the configuration files, that is).

James

To save config files, you click on the penguin in the taskbar, then I think its 'CONFIIGURE' and there should be a save entry.

mr_ed
03-20-2005, 10:30 PM
The process spelled out by Rumo is what Kyle Rankin describes in his book Knoppix Hacks and how I share /home between various Linuxes and BSDs. (For adding distros after the first, though, you only copy over what's new so that you don't clobber what's already there.)

As McGyver points out, you can boot straight into your installation as root so long as you haven't changed root's home directory to /home. Be sure not to su or sudo into root, though, because then you'll still be in /home.

Knoppix in fact rebuilds /etc/fstab on every boot - you can see this in /etc/init.d/knoppix-autoconfig and in the blue and yellow message it generates at boot time saying, "Scanning for Harddisk partitions and creating /etc/fstab..."

Klaus Knopper designed Knoppix to be a replacement for a laptop - he wanted a portable work environment that he could run wherever he was, just by sticking a CD into whatever computer was nearby.

From that point of view, rebuilding /etc/fstab each time is absolutely necessary. Once Knoppix is installed to a hard drive, though, it becomes more of a bug than a feature.

To disable it, you can include the boot parameter (cheatcode) nofstab along with lang=us or vga=791 or whatever else you use at startup.

-- Ed

radnor
03-22-2005, 03:31 AM
moved to it's own question ...