Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Help. How to move home directory

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
jam22cdo
Posts: 1
Joined: 2005-09-20 05:37
Location: Philippines

Help. How to move home directory

#1 Post by jam22cdo »

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?

User avatar
jobezone
Posts: 214
Joined: 2005-06-12 07:20
Location: Portugal

Re: Help. How to move home directory

#2 Post by jobezone »

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
dawgie
Posts: 430
Joined: 2004-06-16 21:30
Location: New Hampshire USA

#3 Post by dawgie »

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

Post Reply