how to move home folder to another partition

Asked by Neil

HI
I want to move the home folder to an other partition, so I can share it with XP for when I have to use Windows, as you all know XP is not smart enough to read Linux hdds,
what I want do do is install Xp in one partition with Ubuntu on another and on the third have "my Document" from XP and "Home" from Ubuntu there. so if I save photos, music etc Xp can use then. so the third partition needs to be ntfs.
and of course Ubuntu needs to be able to write to it automaticly. It is easy on XP just cut and paste MY Docs from one to the other and it is happy to just use it. (wow something easy from Windows lol)
But I don't know how to do it on Ubuntu.

I guess the first question can it be done, 2nd How.
Thank
Neil

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Douglas Moyes (aragorn-stellimare) said :
#1

Actually, you can mount ext2 file systems in Windows, with a driver... but why?

What I've done in the past is use symbolic links to my Windows folders so they sit nicely in my home directory... although you'll want to change a few settings in /etc/fstab

You'll want to add three options: dmask=022,fmask=133,uid=1000

dmaks sets the directory mask to something sane.
fmask sets teh mask to use for regular files, otherwise they'll all be marked with the execution bit set, which isn't cool.
uid sets who owns the mounted partition, uid 1000 normally belongs to the first user created when you installed Ubuntu Linux for the first time.

I don't recommend you make your home directory ntfs. It should be a Linux partition type.

symbolic and hard links are created with ln(1). The -s option tells ln to create a symbolic rather than a hard link. You can't create hard links to directories, or to files on other filesystems. A symbolic links are like shortcuts in windows (guess where where Microsoft got the idea from).

To move the home directory to another partition do something like:

Format the new partition/drive in windows if you want ntfs.

# sudo mount /dev/newpart /mount-point
# sudo mv /home/* /mount-point
#sudo vi /etc/fstab
Add the following line:
/dev/newpart /home fstype defaults 1 1
# sudo umount /mount-point
# sudo mount /home

fstype will be the file system type. Probably one of these:
vfat
ntfs
ext2
ext3
ext4

You don't want ntfs in your home directory... really you don't. Windows filesystems are far too limiting for proper use on Linux. Better to symlink to your windows directories.

Revision history for this message
peter b (b1pete) said :
#2

Neil,

easiest way, just create a new ntfs partition in win of any size you feel comfortable with and call it, say, DATA. then create de mountpoint on any linux kernel you've got and edit /etc/fstab such that you/other users have access privileges to it.

look at that DATA partition as a repository of data files only (...'so if I save photos, music etc Xp can use then. so the third partition needs to be ntfs.'......) that you created in either win or linux fs; it is basically sort of an extension (addition) of /home for data (NOT system conf files) and the beauty of it all is that if something goes wrong with either win or linux os your DATA partition more than likely won't be affected; moreover, you know that all your data is in one place that can be v easily taken good care of either by backing it up or straight copy/paste to some other media.

Can you help with this problem?

Provide an answer of your own, or ask Neil for more information if necessary.

To post a message you must log in.