0

I have a 500 GB hard disk but unable to use the entire space. The only space available to use is around 200GB. The rest is mounted on /usr. Here is what I get after doing df -h.

    munam@munam-Inspiron-3521:~$ df -h
    Filesystem      Size  Used Avail Use% Mounted on
    /dev/sda1       184G  143G   32G  82% /
    none            4.0K     0  4.0K   0% /sys/fs/cgroup
    udev            3.9G  8.0K  3.9G   1% /dev
    tmpfs           798M  1.5M  797M   1% /run
    none            5.0M     0  5.0M   0% /run/lock
    none            3.9G   80M  3.9G   2% /run/shm
    none            100M   60K  100M   1% /run/user
    /dev/sda5       275G  5.1G  256G   2% /usr
    /dev/sda3        88M   64M   19M  78% /boot

I want to utilise that 300 GB mounted on /usr. I will be really thankful if someone helps me do that. Thanks & Regards.

  • Boot an Ubuntu live system (e.g. from the installation DVD/USB drive you used), start GParted, unmount all partitions on the disk, shrink sda5, if necessary, move the other partitions, add the free space to sda1, reboot normally. Note that making a backup before repartitioning is strongly recommended! – Byte Commander Dec 04 '15 at 11:33
  • System was formatted long back by system admin in my company. can I use any other image while booting from a usb. I can not afford to loose even a single file or MB. – techdreams Dec 04 '15 at 11:36
  • You can boot from any live image that contains a partitioning tool like GParted. The Ubuntu installation iso was just an example. And if the data is that important, make a backup first! Partitioning is risky. It might go well 99%, but in 1% the partition gets damaged. Make sure that you would survive it if you belong to the 1%. – Byte Commander Dec 04 '15 at 11:45
  • Bear in mind that df -h will only list mounted partitions. Try using parted with print, or print list. – Progrock Dec 04 '15 at 11:50
  • Boot into a Ubuntu Live Media and update your post with a screenshot of your partition table on Gparted. So we could proceed. – Gayan Weerakutti Dec 05 '15 at 05:26

3 Answers3

1

This solution requires you to backup your existing /usr partition. Remove it. Repartition and format and then restore data. Not using gParted's resize.

Backup your existing /usr as root (see below). And anything else precious to you first of all.

Boot up a live Linux (Gparted Live CD or Ubuntu Live CD) to repartition.

Remove the existing /usr partition, recreate it and format, but make it smaller this time. Make another partition for your data.

Be careful not to remove the wrong partition!

Then restore your data (mount your new /usr partition and extract).

You'll have to edit your system's /etc/fstab to change the disk id.

Then reboot.

To backup your /usr (from the arch wiki backup script):

# tar --xattrs -czpvf /path/to/backup.tgz /usr

To restore from your backup:

# cd /mount/point/of/new/usr
# tar xvzf /path/to/backup.tgz --strip 1
Progrock
  • 486
1

Download GParted Live which is around 200MB and create a bootable GParted USB/CD/DVD using Startup Disk Creator on Ubuntu. Press Super (Windows) button and search for startup disk creator in the Dash.

Boot in to the USB/DVD you just created. You do not have to write commands; everything can be done from the intuitive GUI.

rsl
  • 403
0

Try

sudo apt-get install gparted

Then use it.

But be careful when you use it. If you do some mistake your data may get lost. So try on your home computer first. If you are successful then try on your workplace's computer.