0

I've just installed Ubuntu 14.04 for the first time after Google few pages. Everything is working pretty well except below problem. I've already installed various updates.

Problem : I've 500 Gb hard disk. I assigned 40Gb to root, i.e. "/" and 4Gb to swap, but I'm not able to see rest of the hard disk. Please help.

While installing, I was having complete 500Gb hard disk. I did as per below.

  1. root 40 Gb
  2. swap 4 Gb (equals to RAM)

Am I missing something ?

  • @user68186 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 : 1. root of 40 gb 2. swap of 4 gb 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 4 '14 at 16:41
  • no, I just made 2 (above said). Is 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 4 '14 at 16:48
1

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

  1. Click on the Dash, the gray Ubuntu icon on the top of the Launcher on the left margin of the desktop.
  2. Type gparted
  3. 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

  1. Move the Swap partition to the very end at right side by dragging it, if needed.
  2. 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

  1. Verify again that you are editing the correct partition and not the Live USB or some other hard drive.
  2. 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

  1. Verify again that you are editing the correct partition and not the Live USB or some other hard drive.
  2. 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.

  1. Duplicate your fstab file:

    sudo cp /etc/fstab /etc/fstab.$(date +%Y-%m-%d)

  2. Compare the two files to confirm the backup matches the original:

    cmp /etc/fstab /etc/fstab.$(date +%Y-%m-%d)

  3. 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.

  1. 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

  • Huge Thanks Man. Really appreciate your help and prompt response. :) Love it. But here is one more problem. Please pardon me for that, Actually I'm new to Ubuntu, so committed one more mistake. But I'm learning. Actually I was trying to remove Guest login using command prompt after checking one page of Things to do after installing Ubuntu. But I totally meshed it. :( it was saying to edit something gedit XXXX lightdm/lightdm.conf (only thing which I can recall) and to add a line at the bottom. – Gaurav Aug 4 '14 at 17:34
  • and reboot. But now it's showing nothing... Ubuntu is booting properly. till purple screen is coming then dots below Ubuntu and then Black screen. I thing I've deleted both login accounts and now it has no door for me to let me in. is there any way to create a new user account ? and I can access it again ??? Should I ask it in anohter question ?? – Gaurav Aug 4 '14 at 17:41
  • Done Please, can you have a look at other question. : askubuntu.com/questions/506846/… – Gaurav Aug 4 '14 at 18:08
  • Hello @user68186, I was following up your steps (mentioned above), I noticed one option "Partition" in GParted, I clicked on it and added remaining unallocated 414.26GiB. Now it's showing as a seperated Volume. Will it make any difference in use compare to /home ? Or Can I Go ahead and use it like D: drive (in case of Windows). Also please let me know, /home = somewhat like Part of C: Drive New Volume = somewhat like Part of D: Drive Note : Please have a look in attached snaps. Thanks Gaurav – Gaurav Aug 5 '14 at 14:15
  • Awesome ! You Must be a Ubuntu God :). So it means if I leave my new partition (400+) as it is, I can use it for My data like Movies, songs, documents etc. from the File icon. There won't be any harm ?? I'm asking because I read sometime Ubuntu faces problems mounting New Volume. Can I directly Chat With You to know more stuff about Ubuntu. – Gaurav Aug 5 '14 at 14:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.