[xubuntu-users] How can I select a hard drive as /home directory afterwards?

John Culleton john at wexfordpress.com
Fri Oct 23 22:18:54 BST 2009


On Friday 23 October 2009 16:30:10 Vincent wrote:
> Hi everybody,
>
> Having inserted a new hard drive in my PC, I'm planning to 
install Xubuntu
> 9.10 to that. I then want to move my documents from my old 
hard drive there
> and reformat my old hard drive.
>
> Now, my problem is that I then want to make that hard drive 
my /home
> directory. How would I go about doing that? Do I have to 
manually edit
> /etc/fstab (please say no :).
>
> Thanks in advance,

Reformatting is not necessary. If you want to change the size of 
the partitions etc. cfdisk is your friend.
First you need to give yourself a root password. 
sudo passwd root 
(etc)
Note spelling of passwd command. 
Next  you need to login as root and create an empty directory:
mkdir /mnt/foo
Then mount the old partition on that directory.
mount /dev/sdb1 /mnt/foo -t ext3
---using the correct partition name of course. Run cfdisk /dev/sdb 
or whatever to find the correct partition name. Try sda, sdb, hda, 
hdb.
Next copy the contents of /home to that directory.
cp -p -R /home /mnt/foo
Next you can put a line in /etc/fstab like
/dev/sdb1        /home          ext3        defaults 

---substituting the correct partition name for sdb1 of course. Then 
you need to reboot. 

In any form of Linux manual editing of things like fstab is a fact of 
life.  But it doesn't hurt a bit. 
-- 
John Culleton
"Create Book Covers with Scribus"
http://www.booklocker.com/books/4055.html



More information about the xubuntu-users mailing list