the psycho cat on an HP Mini with Ubuntu
Just Beginning
Which Ubuntu to pick?
Ubuntu inside Windows
Install Software Next Steps Beyond the Basics Playing Around Troubleshooting * Off-site link
Cheap Plugs You may also want to consider donating directly to the Ubuntu project.
|
Create a separate home partition in Ubuntu
Note: I no longer maintain this tutorial. It works fine for me and a lot of other users, but some people have complained that it doesn't work for them, and I don't frankly know enough about this process to help people troubleshoot following these steps.
If this works for you, great. Otherwise, you can try the community site: For help with this, please post on the Ubuntu Forums.
Introduction
Having a separate /home partition makes it easier for you to reinstall Ubuntu while preserving your personal files and settings. This is a matter of convenience but is not foolproof. You should still regularly back up your data.
Important Disclaimers
I'm using the example of a Ubuntu Desktop CD and GParted, but you can very well use QTParted on Knoppix or DiskDrake on PCLinuxOS.
To make room for your new (soon-to-be-/home) partition, right-click an existing partition and select Resize/Move
Now, in my example, my original partition that I shrunk was /dev/sda1, and it created a new partition called /dev/sda3, and my /home folder at this point still lives on /dev/sda1. It's very important that you substitute in your own appropriate partition names for the ones I'm using.
Using the new partitionGo to Applications > Accessories > Terminal to launch the terminal.
Now, back in the terminal, I'm going to mount /dev/sda1 and /dev/sda3 by pasting in these commands (please remember to change the partition device names to the ones appropriate for your setup): sudo mkdir /old
sudo mount -t ext3 /dev/sda1 /old sudo mkdir /new sudo mount -t ext3 /dev/sda3 /new
Now we're going to back up the /home directory on the old partition and move it to the new partition:
cd /old/home
find . -depth -print0 | cpio --null --sparse -pvd /new/ sudo mv /old/home /old/home_backup sudo mkdir /old/home Yes, one of those lines looks really complicated—so please copy and paste the commands into the terminal instead of retyping them.
Note: I have tested the second command myself, and it works, but some have pointed out it might make sense to preface the commands with sudo in case one of the other users has subdirectories manually marked as unreadable to the user making the move. Since I have not tested this out and all directories and readable to all by default, I'm offering this as only an alternative in case the command as given does not work:
Next, we're going to specify to use the new home partition as /home:
sudo cp /old/etc/fstab /old/etc/fstab_backup
gksudo gedit /old/etc/fstab
You'll then see the /etc/fstab file opened in the Gedit text editor. Add in this line at the end of the file: /dev/sda3 /home ext3 nodev,nosuid 0 2
Save the file and exit Gedit. After you reboot, you should be now using your new /home partition. If you find that you are running out of room on your old partition and you're pretty confident everything is working as it should be, then go ahead and delete the backup of home:
sudo rm -rf /home_backup
It's very important you paste in the above command. Retyping it could be extremely dangerous if you mess up, and you could end up deleting your entire installation.
Boot into recovery mode (if you don't know how to do this, go to this section of another tutorial).
chown -R username:username /home/username
chmod 644 /home/username/.dmrc chmod 644 /home/username/.ICEauthority exit where username is your actual username. Obviously, you'd repeat the first three commands for all users experiencing the problem before you typed exit.
If, for some reason, no matter what you try, the separate /home doesn't work, that's why we have a live CD, so we can fix things.
Boot up the live CD, go to a terminal, and paste in (being sure to change the partition device name, of course): sudo mkdir /recovery
sudo mount -t ext3 /dev/sda1 /recovery sudo cp -R /recovery/home_backup /recovery/home sudo cp /recovery/etc/fstab_backup /recovery/etc/fstab Then, reboot.
|
If you have suggestions or corrections for these tutorials, please post in this Ubuntu Forums thread or leave a comment on my blog. I will not give help to people posting in the above places. If you require technical support, start a support thread on the Ubuntu Forums. That is the appropriate place to ask for help. |