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
  • 70,465
Pavel
  • 105
  • Please note that the 990GB partition is now considered as Free Space as I kept switching things around hoping I will fix it, but ended up unmounting and restoring the partition, seeing I couldn't fix it. – Pavel Jan 09 '18 at 17:09
  • 2
    Or, you could just sudo parted resize /dev/sda2 30000 and then sudo resize2fs /dev/sda2 which will bring your root partition to 30 GB – Charles Green Jan 09 '18 at 17:48
  • 3
    Please shorten the question to the facts and elaborate the title. "Complete Disaster" may be the obvious working title for you now, but is not a very descriptive title. – Jonas Stein Jan 09 '18 at 19:19

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,339
  • It seems I don't have enough space for gparted but I entered command mode and accessed the cfdisk command, with lots of partition options to choose from and I'm not sure how to proceed from here. – Pavel Jan 09 '18 at 17:49
  • 1
    @Pavel Added another section at the top of the answer... – Charles Green Jan 09 '18 at 17:56
  • Well, I am completely doomed now. I can't even enter my own Desktop now. I type my password and I get booted back into an endless loop, I can only join Guest... – Pavel Jan 09 '18 at 18:21
  • 1
  • 1
    @Pavel ctrl+alt+f1 should dump you into a text terminal where you can login? – le3th4x0rbot Jan 09 '18 at 20:58
  • I have literally tried everything. There are commands in these recovery options that either do absolutely nothing or display an error message. It's like I'm the only one with this problem. – Pavel Jan 09 '18 at 22:03
  • Tomorrow I'll try putting Ubuntu on an USB stick using my old laptop and try to reinstall the operating system. Is this a solution? – Pavel Jan 09 '18 at 22:45
  • 1
    @Pavel You're not the only one with this problem, but you might be better off joining the #ubuntu IRC channel on Freenode for some real-time help if you can. Barring that the login loop you're stuck on may be related to your encrypted home directory coupled with the full disk. Most Ubuntu systems are configured to let you enter a recovery shell as a menu option at boot time. Using that with the parted and resize2fs commands at the top of this answer may fix it for you. – Perkins Jan 09 '18 at 22:52
  • 1
    @Pavel unless you've somehow destroyed your data in your attempt to resize your partition a reinstall shouldn't be necessary, simply boot from the USB stick and use gparted to resize to the full size of the disk. – Perkins Jan 09 '18 at 22:53
  • I will do this in the next couple of days and I'll be back with a verdict, thank you so much, so far, fellas! For your time, nerves and effort. Hoping to be back with good news. I'll keep checking around just in case. – Pavel Jan 09 '18 at 22:57
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