If you don't want a separate /home
partition Easiest
First: Reboot your computer using the Live USB/DVD/CD
This is the way you have installed Ubuntu. Use the same Live USB/DVD you had used before to boot your computer. Choose the "Try Ubuntu" option. Do not choose Install Ubuntu!
Second" Start Gparted
- Click on the Dash, the gray Ubuntu icon on the top of the Launcher
on the left margin of the desktop.
- Type gparted
- Click on the Gparted icon that shows up
Third: Make sure the main window is showing your hard drive you want to adjust.
Gparted should show the two partitions you created and the free space.
Fourth: Move and resize
- Move the
Swap
partition to the very end at right side by dragging
it, if needed.
- Drag the right edge of the
/
partition as close to the Swap
partition as it would go. There may be a small gap of 1MB or so in
between. This is normal.
Fifth: Apply
- Verify again that you are editing the correct partition and not the
Live USB or some other hard drive.
- Click the Apply button in Gparted to actually do the work.
Wait till everything completes this is very important. If you stop the process in between your computer will not boot and you will have to install Ubuntu again.
Finally: Reboot
When prompted remove the LiveUSB/DVD and boot Ubuntu normally from the hard drive.
If you want a separate /home
partition
Follow the first three steps as before. That is:
First: Reboot your computer using the Live USB/DVD/CD
Second" Start Gparted
Third: Make sure the main window is showing your hard drive you want to adjust.
Fourth: Move swap
to the end
**Create a new partition in the unallocated space of the format ext4
. Verify and write down the device name of this partition. It should be something like sda3
. The actual name may be different.
Fifth: Apply
- Verify again that you are editing the correct partition and not the
Live USB or some other hard drive.
- Click the Apply button in Gparted to actually do the work.
Wait till everything completes this is very important. If you stop the process in between your computer will not boot and you will have to install Ubuntu again.
Sixth: Reboot
When prompted remove the LiveUSB/DVD and boot Ubuntu normally from the hard drive.
Seventh: Open a terminal by pressing Ctrl+Alt+T
Get the UUID of the new partition by entering
sudo blkid
in the terminal.
Now you just need to take note (copy & paste into a text-file) the uuid of the partition that you have set-up ready to be the new /home partition.
Eighth: Setup fstab
Your fstab is a file used to tell Ubuntu what partitions to mount at boot. The following commands will duplicate your current fstab, append the year-month-day to the end of the file name, compare the two files and open the original for editing.
Duplicate your fstab file:
sudo cp /etc/fstab /etc/fstab.$(date +%Y-%m-%d)
Compare the two files to confirm the backup matches the original:
cmp /etc/fstab /etc/fstab.$(date +%Y-%m-%d)
Open the original fstab in a text editor:
gksu gedit /etc/fstab
and add these lines into it
# (identifier) (location, eg sda5) (format, eg ext3 or ext4) (some settings)
UUID=???????? /media/home ext4 defaults 0 2
and replace the "????????" with the UUID number of the intended /home partition.
- Save and Close the fstab file
then type the following command:
sudo mkdir /media/home
This command will create a new directory, later used for temporarily mounting the new partition. At the end of the procedure this directory can be removed.
Now you can restart your machine or instead of rebooting you might prefer to just re-load the updated fstab
sudo mount -a
Either should have mounted the new partition as /media/home. We will edit the fstab again later so this arrangement of the partition is only temporary.
Nineth: Copy your original home to the new home
Next we will copy all files, directories and sub-directories from your current /home directory into the new partition:
sudo rsync -aXS --exclude='/*/.gvfs' /home/. /media/home/.
The --exclude='/*/.gvfs' prevents rsync from complaining about not being able to copy .gvfs, but I believe it is optional. Even if rsync complains, it will copy everything else anyway. (See here for discussion on this)
Tenth: Preparing fstab for the switch
Modify the fstab again to point to the new partition and mount it as /home. So again on a command-line
gksu gedit /etc/fstab
and now edit the lines you added earlier, changing the "/media/home" part to simply say "/home" so that it looks like this:
# (identifier) (location, eg sda5) (format, eg ext3 or ext4) (some settings)
UUID=???????? /home ext4 defaults 0 2
Then, press Save, close the file but don't reboot just yet.
Eleventh: Moving /home into /old_home (to be safe)
In the terminal enter the command:
cd / && sudo mv /home /old_home && sudo mkdir /home
This will move the current home to old_home and create a new folder called /home
to be used as the mount point of the home partition.
Finally: Mount the new home partition by entering
sudo mount -a
there is no need to reboot!
When you are sure everything is fine, you can delete the /old_home folder:
Deleting the old Home
You can delete your old home directory with:
cd /
sudo rm -r /old_home
Be careful with the above command as mistyping it could result in the deletion of other files and directories.
See https://help.ubuntu.com/community/Partitioning/Home/Moving for more details.
Hope this helps
No I wanted to make an Ubuntu machine, so I formatted completed hard disk like a new one.
I wanted to see drive where I can store media files, my office files, Movies, songs and other Networking Stuff.
When I was installing it I created 2 parts like below :
I think leftover partition should be assign may be under /home. but I'm not sure.
Hope it clears. Will do gparted and screenshot in few minutes.
– Gaurav Aug 04 '14 at 16:41Is there any way to do it now ?? But please tell me anyway to without un-installing Ubuntu. I don't want to waste downloded and updates. I've limited Mbs left.
Thanks
– Gaurav Aug 04 '14 at 16:48