11

I have sufficent memory , but somehow I get my /dev/loop0 showing usage of 9 GB here's my df-h.

Filesystem      Size  Used Avail Use% Mounted on
/dev/loop0       12G   10G  1.4G  88% /
udev            2.0G  4.0K  2.0G   1% /dev
tmpfs           785M  904K  784M   1% /run
none            5.0M     0  5.0M   0% /run/lock
none            2.0G  1.9M  2.0G   1% /run/shm
/dev/sda6        20G   14G  6.4G  68% /host
/dev/sdb1       400M  4.5M  395M   2% /media/LABEL1
/dev/sdb2       3.3G  1.9G  1.2G  62% /media/LABEL2
/dev/sda5       175G  142G   33G  82% /media/DATA

I tried checking out what was in there. But that only cause a loadof gibberish to be printed on the terminal following which my system crashed.

Any help would be appreciated.

4 Answers 4

3

This loop device is not taking up any space. Image and ISO files can be mounted to this virtual device. With /dev/loop0 being mounted on /, I assume this is a Wubi system? If so, something else is using your space. If this is a Wubi system, /dev/loop0 will show the space left and used on the virtual hard-drive image on the physical hard-drive.

You can use the "du" command to figure out the real file(s) taking your space.

2

I cannot add a comment on the above answers because of my low reputation so I add here a new "answer" (which actually isn't). According to Devyn Collier Johnson we can use "du". It does not produce any result for me:

du /dev/loop0
0   /dev/loop0

I still do not know why/where/how I am using almost all the space. I also tried to resize it. Since I do not have a live CD/USB I tried a "live resize" (https://help.ubuntu.com/community/ResizeWubiDisk) but when doing:

sudo losetup -c /dev/loop0/
loop: can't set capacity on device /dev/loop0/: Not a directory

In conclusion: I cannot go in either way. I can't neither delete unused/unwanted stuff or enlarge /dev/loop0/. I hope someone can help!

Update: I tried to do the "live resize" again and I do not why this time doing "sudo losetup -c /dev/loop0/" just hang the computer. What I tried is to skip that step and it worked. Now I increased the /dev/loop0 size. However, I still do not know where/how I am using the disk space....

1
  • Well, /dev/loop0 is not a directory, you shouldn't add a slash after it. I get the same Not a directory error if I repeat your command, but if I drop the trailing slash, I get: ` $ losetup /dev/loop0 /dev/loop0: []: (/var/lib/snapd/snaps/core_1337.snap)`
    – arielf
    Mar 14, 2017 at 1:05
1

Um, well I can't tell you why, but I can tell you how to fix the problem. Just follow the instructions given by https://help.ubuntu.com/community/ResizeandDuplicateWubiDisk to expand your disk partition for Ubuntu, if you installed Ubuntu using wubi.exe on a Windows OS. Additionally the following terminal (which can be opened by: ctrl+alt+T) commands may (or may not, unfortunately from the information I have available to me I just don't know) free up some disk space:

sudo apt-get autoremove

Then remove any unused kernels by copying and pasting the following commands into terminal.

uname -r

Taking note of all unused kernels. (The most recent kernel, (i.e. the one with the biggest number) will be the one you're using at the moment) Then when you're sure as to which kernel you're going to remove type the following:

sudo apt-get purge linux-image-x.x.x.x-generic

Where x.x.x.x refers to the linux kernel you're trying to remove.

1
  • 2
    Im actually interested in getting my lost space back ,ratherthan allocating more space!
    – seeker
    Nov 4, 2012 at 19:04
1

Here is what you need to do to see what is on /dev/loop0.

sudo mkdir /mnt/loop0
sudo mount /dev/loop0 /mnt/loop0
cd /mnt/loop0
ls -la

This will allow you to move the files to an alternate location off the machine and once the files are moved I would delete the devices since you have the data if it is necessary to still remove the devices due to growing storage.

I would suggest that you do something along the lines of sudo nautilus then do a select all copy and paste the files on to an alternate location like google drive or a location with a large storage area that can grow. Because those loop files can have a large size once extracted themselves.

An additional note a /dev/loop with a assigned number is a block device for an snap application. Your /dev/loop0 is full because you continue to use the app associcated with the block device and whatever that app is creates or increases the block device sized based on usage if it is full then you need to uninstall the app or move the app install location to a different drive.

Here is the way to tell what application is using the /dev/loop0 and filling your drive space.

Execute in a administrative shell the following command.

losetup

It should output an example as such.

NAME        SIZELIMIT OFFSET AUTOCLEAR RO      BACK-FILE                                 
/dev/loop0          0      0         1  1 /var/lib/snapd/snaps/bare_5.snap

So clearly we know now that the bare_5.snap application and processes on the block device have filled its allotted size limit.

For further explination on block device management and how file systems compress please reference the following link. system mounts /dev/loop0 on /snap/core/3604 and it's 100% full, where is it coming from?

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .