Help. How to move home directory

If none of the more specific forums is the right place to ask

Help. How to move home directory

Postby jam22cdo » 2005-09-20 05:54

I am new to linux and chose knoppix hard disk install which I understand is Debian. I have partitioned my hard disk to separate my data files from the other system files.

How can I move the home directory to the new partition. Is their a gui program in KDE for it?
jam22cdo
 
Posts: 1
Joined: 2005-09-20 05:37
Location: Philippines

Re: Help. How to move home directory

Postby jobezone » 2005-09-22 00:00

jam22cdo wrote:I am new to linux and chose knoppix hard disk install which I understand is Debian. I have partitioned my hard disk to separate my data files from the other system files.

How can I move the home directory to the new partition. Is their a gui program in KDE for it?


I'm really not sure how to do that after you install. Perhaps backing up your home dir, puting it in the new partition, then create a line which would look something like this in your /etc/fstab ?
Code: Select all
/dev/partition       /home               ext3    defaults        0       1


But again, I don't know if it's as simple as this. I have a friend which installed Debian from scratch, and in debian installer chose a different partition to be home.
The Debian Documentation website contains the FAQ, Installation Manual and the Release Notes for Etch. They're helpful if you want to learn more about debian!
User avatar
jobezone
 
Posts: 220
Joined: 2005-06-12 07:20
Location: Portugal

Postby dawgie » 2005-09-22 13:56

You need to do this from the command line.
You need to know the device name of the partition that you are using
You should know what filetype you are using (ext3, reiserf, etc)
You should be familiar with basic use of vi (or another text editor that you can use in a shell)

Log out of xwindows and <ctrl>+<alt>+<F1> and login as root.
Go to single user mode:
# init 1
Enter your root password to go to single user mode

First create a directory to mount the partition that will be the new home:
# mkdir /mnt/newhome
Mount the partition (where XX is the device number & letter):
# mount /dev/hdXX /mnt/newhome
Copy everything from /home to your new home:
# cp -axv /home/* /mnt/newhome
When this is complete, rename your /home directory:
# mv /home /oldhome
Unmount you temporary newhome directory:
# umount /mnt/newhome
edit your /etc/fstab file to create the entry for your new home directory.
I use vi:
# vi /etc/fstab
Add a line like this (make sure that you know your file type I use ext3):
/dev/hdXX /home ext3 defaults 0 1
Make sure that you have a blank line on the end of your fstab file (hit <enter> after the last line in the file).

After you save your changes, update your system to the fstab changes:
# mount -a
If you get no errors, you can go back to multiple user mode:
# init 3
You can remove your temporary newhome directory:
# rm /mnt/newhome
Once you are satisified that everything is ok, you can remove your /oldhome
User avatar
dawgie
 
Posts: 431
Joined: 2004-06-16 21:30
Location: New Hampshire USA


Return to General Questions

Who is online

Users browsing this forum: Bloom and 3 guests

fashionable