Unable to log into system II

Today, I tried to access UB, but I can’t get past the login screen.

From the TTY terminal, I tried to reinstall the system , but I always the error message: . not enough space in var/cache/apt/ archives

From searching the web, I discovered that this seems to be related to a full disk, but I have a new 240 GB SSD and I am really not sure about that.

What could I try?

You might need to boot to a live session (usb)

How did you do the partitions? I am guessing you separated / , /boot, /home ?

Look at the disk space being used by the partitions df -sk

Hi, David. - sk seems to be an invalid option. Only df returns the output from the photo below.

sdb is my SSD. So it actually seems to be full. Strange…

Shouldn’t there be some mechanism in place to alert the user and to prevent the system from becoming inaccessible?

What is the the best way to proceed from here?

Guess so - needs to be something to notify - warning threshold etc. Nice little project for someone I would dare to suggest.

I would login via a TTY (CTRL+ALT+F3) - then look to uninstall/delete stuff that you don’t need. Just remove enough so that you can then login graphically (CTRL+ALT+F7 to switch back to the login screen)

Then use Disk Usage Analyser to have a much closer look at what areas are taking the most space - you can use that info to judge what needs to be cleaned up/moved to another drive etc.

df -k is the correct option to display space is Kilobytes - but anyway you’ve identified the key culprit - just completely exhausted /dev/sdb.

I uninstalled chrome, libreoffice and Mailspring. When doing df, the occupied space went down from 229 MB to 224 MB, but percentage still says 100% full.

Size ----- Used ----- Available ------ Use%
229… ----- 224… -------- 0 ----------- 100%

And I am still unable to log in …:frowning:

In terms of percentage removing just that small number is approx 100%. You will still need to remove more than that … try to get to around 95%

Will try … do you a command to list applications by size? I have tried

 dpkg-query -Wf '${Installed-size}\t${Package}\n' | column -t

but it lists an enormous quantity and I am unable to scroll through the TTY terminal …

Or is there a command to easily remove all the packages I have installed?

Just add | more

That will allow you to page.

I am assuming you don’t have a usb to boot into a live session? You can use that to look for large files in a gui.

1 Like

Good idea, I have already downloaded the ISO and will make a bootable USB

That helped, many thanks … I had a huge Virtual Machine on my drive, consuming some 40GB. Now I am going to uninstall some unused packages and move some files … thanks for looking into this

1 Like

ncdu - given you have some available space to install it - is also a nice tool to manage files from terminal or console.

I will check it out, thanks …

By the way, what is the size of a Ubuntu installation? 10 GB? I wonder why my drive is full if I haven’t installed too much stuff and no heavy programs. The biggest was NetBeans

1 Like

It depends actually on the number of software you install. After few weeks here my UbuntuBudgie 20.04 shows :
7,7 GiB for /usr
4,9 GiB for /snap
5,3 GiB for /home [ given that it’s mainly the hidden files for 3 users, personal documents are on another storage ]
3,2 GiB for /var

It’s a default installation ( not minimal ) + some added software.

So… 10 GiB can’t be enough. I’d say at least 30.

Next time, try :

df -Th | grep -v loop

for easier reading :wink:

@Coeur-Noir , I have installed the little ncdu application and been digging into where my disc space went …

It doesn’t make sense when you look at the graph from the Disk Usage Analyzer :

occupied space is 181 GB, but the installed applications account for less than 30 GB. It doesn’t add up.

Now, there is this sdc1 (partition?) that uses 144 GB of space. Where does that come from ???

Mmmm… we might need to see how are organized your partitions.

Which ones are mounted at start :
cat /etc/fstab

Which ones are visible :
( enlarge or maximize your terminal before issuing that command )
lsblk -f | grep -v loop

Which ones are actually used :
df -Th | grep -v loop

ncdu is a folder/file view not a disk/partition usage view.
It helps browsing data with a logical user point of view through files and folders as they are displayed by the system. It’s not for browsing devices, from a physical point of view.

ncdu 1.14.1 ~ Use the arrow keys to navigate, press ? for help                          
--- / ----------------------------------------------------------------------------------
. 486,0 GiB [##########] /media                                                         
    7,7 GiB [          ] /usr
.   5,3 GiB [          ] /home
.   4,9 GiB [          ] /snap
.   3,3 GiB [          ] /var
  189,9 MiB [          ] /boot
.  12,7 MiB [          ] /etc
.   1,9 MiB [          ] /run
. 144,0 KiB [          ] /tmp
!  16,0 KiB [          ] /lost+found
e   4,0 KiB [          ] /srv
!   4,0 KiB [          ] /root
e   4,0 KiB [          ] /opt
e   4,0 KiB [          ] /mnt
e   4,0 KiB [          ] /cdrom
.   0,0   B [          ] /proc
.   0,0   B [          ] /sys
    0,0   B [          ] /dev
@   0,0   B [          ]  libx32
@   0,0   B [          ]  lib64
@   0,0   B [          ]  lib32
@   0,0   B [          ]  sbin
@   0,0   B [          ]  lib
@   0,0   B [          ]  bin
 Total disk usage: 507,5 GiB  Apparent size: 507,4 GiB  Items: 1523556                  

↑ ncdu shows you which folder/files your operating system uses to manage the whole amount of attached data.

Therefore only attached partitions ( = mounted into a folder ) are visible and counted.

Links are shown with an @ at beginning of line, but not counted ( or only once for hard links ).
e at beginning of line is for empty folder.

Full gauge here does not mean 100% capacity but « the heaviest ».

I figured out something interesting this morning: the sdc1 at the very top is actually not a partition. It came to me when I did an analysis with GParted. The is no sdc1 partition anywhere on my machine, SSD, HDD or else.

So I used Nautilus to go hunting for the big files in my root folder, and found A SINGLE BINARY file consuming a whopping 154 GB of space.

So the sdc1 you see at the very top looks like a partition, but it is a FILE. I renamed it and restarted my machine, and after seeing that everything is working normally, I just deleted it and had 154 GB (!!) more space.

But I wonder how the file got into my root folder in the first place … there is also another binary file named “swapfile” with 2 GB, that I suspect doesn’t belong there.

Any hints?

swap partition vs. swap file https://askubuntu.com/questions/904372/swap-partition-vs-swap-file so such a file may sound normal. Unless you also have a swap partition. Then check which one is active on your system, you may remove the unused one.

is this the same machine and installation as in Change Home Folder Location ? Remember here you have something weird : « sdb is your SSD. I’m a bit bugged that sdb shows no partition (…) might suggest later issues - be aware your current setup may not be perfect as is. »

when someone suggests some commands, please post their outputs here.

cat /etc/fstab
lsblk -f | grep -v loop
df -Th | grep -v loop

were precisely meant to « visualize » your discs and partitions, how they are organized and if/which ones are automatically mounted at start, or not.

sdc1 is a strange case. Might have been an iso image of an older partition ? Did you ever try to clone a system or a partition ? I just hope here it was not an actual partition, not yet mounted…

Yes, it is the same machine as is “Change the Home Folder Location”.

The output of cat /etc/fstab :

file system>
/ was on /dev/sdb during installation
UUID=b125e762-265d-4e0d-a206-74c5d5a42c04 / ext4 errors=remount-ro 0 1
/boot/efi was on /dev/sda1 during installation
UUID=CC65-3241 /boot/efi vfat umask=0077 0 1
/home was on /dev/sda5 during installation
UUID=2f5311a1-7d88-408c-8c07-c6e904cf259e /media/DATA ext4 defaults 0 2
/swapfile none swap sw 0 0

The output of lsblk -f | grep -v loop

├─sda1 vfat SYSTEM CC65-3241 223M 13% /boot/efi
├─sda3 ntfs OS 523C67B63C67942F
└─sda5 ext4 2f5311a1-7d88-408c-8c07-c6e904cf259e 200G 59% /media/DATA
sdb ext4 b125e762-265d-4e0d-a206-74c5d5a42c04 181,5G 12% /

df -Th | grep -v loop returns

Filesystem Type Size Used Avail Use% Mounted on
udev devtmpfs 3,8G 0 3,8G 0% /dev
tmpfs tmpfs 782M 27M 756M 4% /run
/dev/sdb ext4 220G 27G 182G 13% /
tmpfs tmpfs 3,9G 210M 3,7G 6% /dev/shm
tmpfs tmpfs 5,0M 4,0K 5,0M 1% /run/lock
tmpfs tmpfs 3,9G 0 3,9G 0% /sys/fs/cgroup
/dev/sda5 ext4 550G 322G 200G 62% /media/DATA
/dev/sda1 vfat 256M 34M 223M 13% /boot/efi
tmpfs tmpfs 782M 28K 782M 1% /run/user/1000

sdc1 is a strange case Might have been an iso image of an older partition ? Did you ever try to clone a system or a partition ? I just hope here it was not an actual partition, not yet mounted…

No, I didn’t try to clone a system or partition. There was also no .iso extension to the file. And to be an unmounted partition, deleting it would somehow hamper the performance of my system, right? What is not the case.
Maybe it happened during the installation of the Ubuntu system to the SSD drive. Some choice I made, that I am not aware of.

⋅ For posting commands outputs, terminal prompt may matter and prefer :

as it keeps everything in place and does not delete any letters or symbols.

⋅ regarding sdb showing no partition
This might happen when a whole disc is used as a partition.
Beware this can be a problem for any operation expecting a well defined partition.
Some software may not be able to see or to mount sdb as they would expect sdb# where # is a clearly defined partition.
I really wonder how you did that :wink: Did you just format that disk without creating partition ?

can’t see anything too weird beside. There is a windows system there, for a dual boot, right ?

⋅ you may have an eye to your /media/DATA I suspect here some space to take back as it seems to come from a previous /home partition.
And at the time of the other discussion, you had an entire older system nested into your actual /home.

⋅ for sdc1 well too late and too bad we’ll never know :grin: Don’t be too fast at deleting things, sometimes it prevents understanding the « why » and the « how » things happen. Anyway you did it carefully by first renaming the weird file in order to check, so, well done.

Is everything running smooth now ?

I just went through the installation process (the "something else " option ) and might have taken an inaccurate choice along the way. But I really don’t remember all the details.

And yes, there is a Windows system, that I need for software that’s not available for Linux.

There is a previous home partition on the HD, that I could try to get rid of, after carefully checking the contents, but that would also imply into messing with the boot process, right?

For the more, yes, everything is running smoothly, yes.

Thanks for your time and your great help. q