10

I've always used Windows as an operating system, which is not a surprise, but recently, I've seen a really good deal for a Desktop PC, the only downfall in my case was that it came with Ubuntu pre-installed. I did my research before buying and saw that Ubuntu offers a lot of benefits, and I really wanted to try something new out and well, here I am!

A partition-installation pops up and no options, only 2 partitions I could choose from, one with around 10GB which was allocated for the system I suppose and 990GB for myself, but... no resizing, editing, adding options, the only button I could press was Forward, came with an error that GRUB failed to be installed on any on the partitions and went on. Excited, I started doing all the first boot-up stuff, updates and such, and after all was finished, I went on to try out a game to see how the PC feels, and went on to install Steam, only for the system to say that I have no space left, even though I should have an untouched partition with 990GB left.

And now I am unable to even download another version of Ubuntu to put on a USB stick to reinstall, and on the Disks app it says Filesystem Partition 2 8.0GB Ext4 /dev/sda2 mounted at Filesystem Root and the other partition which the PC sees it as an external hard drive since I can just eject it, and I can mount and unmount it at any time, regardless of which type I use, I simply can't use that space.

Now I have no space to do anything.

Here's what the df -h command shows:

Filesystem                 Size  Used Avail Use% Mounted on    
udev                       3,9G     0  3,9G   0% /dev    
tmpfs                      785M  9,5M  776M   2% /run
/dev/sda2                  7,3G  6,9G  576K 100% /    
tmpfs                      3,9G   26M  3,9G   1% /dev/shm    
tmpfs                      5,0M  4,0K  5,0M   1% /run/lock
tmpfs                      3,9G     0  3,9G   0% /sys/fs/cgroup    
cgmfs                      100K     0  100K   0% /run/cgmanager/fs    
tmpfs                      785M   64K  785M   1% /run/user/1000    
/home/lightriphy/.Private  7,3G  6,9G  576K 100% /home/lightriphy

This is the lsblk command information:

lightriphy@Lightriphy-HQ:~$ lsblk    
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT    
sda      8:0    0 931,5G  0 disk     
└─sda2   8:2    0   7,5G  0 part /    
sr0     11:0    1   3,5G  0 rom  

And this is the sudo parted -l command information:

Model: ATA ST1000DM010-2EP1 (scsi) 
Disk /dev/sda: 1000GB 
Sector size (logical/physical): 512B/4096B 
Partition Table: msdos 
Disk Flags: 

Number  Start   End     Size    Type     File system  Flags  
 2      4096MB  12,1GB  8000MB  primary  ext4
Zanna
  • 72,312
Pavel
  • 105

2 Answers2

8

It appears that during installation, the 990 GB that you expect to see was not partitioned and mounted.


Per your comment, you can't get gparted to install. You can resize your root partition with the following command set:

sudo parted resize /dev/sda2 30000
sudo resize2fs /dev/sda2

This would increase the size of your root partition to 30 GB. I would then install gparted, and increase the size of the partition there to encompass your entire disk, although other people prefer different partition schemes.


The utility 'cfdisk' should be already installed on your system, and can be used to create a new ext4 partition. Alternatively, you may be able to create enough free space on your current partition to install gparted by

sudo apt autoremove
sudo apt clean
sudo apt install gparted

If you can get gparted working, you can extend the size of '/dev/sda2' to occupy the entire disk. Alternatively, there is a procedure for creating a new home diectory...


Using either 'gparted' or 'cfdisk', create a new partition in the empty space on your disk. blkid should then be used to find the UUID of the partition, which you will need.

Having a partition and the UUID: the steps are then listed below but please read https://help.ubuntu.com/community/Partitioning/Home/Moving for a detailed description of what's going on.

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

Open the original fstab in a text editor:

sudo 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 

Now mount the new partition

sudo mkdir /media/home
sudo mount -a

Copy your current home directory to the new location, move the location of the current home directory, and change the mountpoint of the partition, and eventually reboot...

sudo rsync -aXS --exclude='/*/.gvfs' /home/. /media/home/.

We now need to modify the fstab again to point to the new partition and mount it as /home. So again on a command-line

sudo 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    ext3          defaults       0       2


cd / && sudo mv /home /old_home && sudo mkdir /home
sudo reboot

You should now have your '/home' directory on the new partition (with a lot of free space), and can remove the '/old_home' directory, freeing some space on the primary disk.

Charles Green
  • 21,859
0

Everything is now all right and working flawlessly. I have succesfully reinstalled the system using a USB stick with the help of a tutorial and the Rufus application, wiped out all the data of the previous one, and partitioned the space correctly. I sincerely thank you all, especially Charles Green for your time and effort and sorry the lack of knowledge I have upon Ubuntu. It'll get better in time!

Pavel
  • 105