RPI2 - No space left on device

Having issues with your DietPi installation, or, found a bug? Post it here.
francescoG
Posts: 9
Joined: Sat Dec 31, 2016 1:19 pm

RPI2 - No space left on device

Post by francescoG »

Hi
I use a raspberry pi 2 with a 3TB HDD USB and 16G SD.
I installed ProFTP, BitTorrent, Kodi and MiniDLNA and I am using them from about one mounth without issues.

Now, BitTorrent does not work correctly because of

Error: Unable to save resume file: No space left on device

I ran 'df' command and I found that /dev/root is 100% used.
I ran 'du' command under root directory to undestand which are the files filling space but the only ones present are kodi files and they fill just 159M.
I also updated dietpi from 142 to 143 rev without any advantage.

How is it possible?

Can you help me to solve this mystery?
Thanks

Francesco
User avatar
Fourdee
Site Admin
Posts: 2788
Joined: Tue Feb 06, 2007 1:36 pm

Re: RPI2 - No space left on device

Post by Fourdee »

francescoG wrote: Now, BitTorrent does not work correctly because of

Error: Unable to save resume file: No space left on device
Hi,

Possible data meant for USB drive has been stored on SD card. This can occur if the USB drive is not mounted during boot (can happen, especially with RPi).

Lets check current filesystems. Please take you take a picture/screenshot of the following commands:

Code: Select all

df -h
blkid
Lets check userdata location:

Code: Select all

readlink -f /mnt/dietpi_userdata
Now lets check if any user data is stored on SD:

Code: Select all

dietpi-services stop
umount /mnt/usb_1
ls -lha /mnt/usb_1
If the drive fails to unmount, delete all pending transmission downloads, power off system, unplug USB drive, power on. Then run:

Code: Select all

ls -lha /mnt/usb_1
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal or become a DietPi patron.
francescoG
Posts: 9
Joined: Sat Dec 31, 2016 1:19 pm

Re: RPI2 - No space left on device

Post by francescoG »

Hi,

thanks for the quick reply.

I followed the steps that you've shown me (see attached file Immagine.jpg).

I also deleted all pending transmission downloads and unpluged USB drive.

But when I power on, RPI generates the error showed in attached immagine2.jpg
Note that this issue is very similar to that I wrote to you in my previous thread (see http://dietpi.com/phpbb/viewtopic.php?f=11&t=1123).
Attachments
command echo
command echo
occurred error
occurred error
User avatar
Fourdee
Site Admin
Posts: 2788
Joined: Tue Feb 06, 2007 1:36 pm

Re: RPI2 - No space left on device

Post by Fourdee »

francescoG wrote:But when I power on, RPI generates the error showed in attached immagine2.jpg
Is this when the drive is plugged in?

It looks like RootFS is filled, I believe due to USB drive not being mounted during a boot, transmission downloads then stored on SD.

You need to psyhically remove the USB drive from system, power on, then run following to free up the space:

Code: Select all

rm -R /mnt/usb_1/*
If you do the above with USB drive attached, you'll lose all your data on USB drive, so please check.

As for a prevention:
DietPi adds rootdelay=10 to /boot/cmdline.txt as a workaround for this known issue. Although, some drives may still not be detected during each boot. You could try increasing this value.
This is a problem with the RPi itself.
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal or become a DietPi patron.
francescoG
Posts: 9
Joined: Sat Dec 31, 2016 1:19 pm

Re: RPI2 - No space left on device

Post by francescoG »

I accurately followed the steps that you've shown me, so the error is when I powered on the system without USB drive (psyhically removed from system).
Any way, despite the error, I tried to run

rm -R /mnt/usb_1/*

in a putty window but RPI remains as if it were frozen (I have to use Ctrl C to have the cursor back again) see immagine3.jpg

After this, when I reboot the system always without USB drive plugged in, I always have the error showed to you in immagine2.jpg

I do not know if it is important but there is not any /var/swap directory on my RPI. swap file is on USB drive.
Attachments
Immagine3.jpg
User avatar
Fourdee
Site Admin
Posts: 2788
Joined: Tue Feb 06, 2007 1:36 pm

Re: RPI2 - No space left on device

Post by Fourdee »

francescoG wrote: in a putty window but RPI remains as if it were frozen (I have to use Ctrl C to have the cursor back again) see immagine3.jpg
Ok, we'll need to disable the mount entry for this drive, SystemD is waiting for the drive to become available and will hang those commands.
  • Edit fstab:

    Code: Select all

    nano /etc/fstab
  • Comment out the line with /mnt/usb_1, eg:

    Code: Select all

    #/dev/sda1       /mnt/usb_1      auto     defaults,noatime,nofail,x-systemd.automount  0 0
  • Save and exit (ctrl+x, y, enter)
  • Reload systemd

    Code: Select all

    systemctl daemon-reload
  • reboot
Now you should be able to run these commands successfully, to remove the data on SD card. Make sure USB drive is not attached:

Code: Select all

df -h
rm -R /mnt/usb_1/*
df -h
Onces thats done, you'll need to renable the /etc/fstab mount entry again. Simply repeat steps above and uncomment the /mnt/usb_1 entry, eg:

Code: Select all

/dev/sda1       /mnt/usb_1      auto     defaults,noatime,nofail,x-systemd.automount  0 0
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal or become a DietPi patron.
francescoG
Posts: 9
Joined: Sat Dec 31, 2016 1:19 pm

Re: RPI2 - No space left on device

Post by francescoG »

Edit fstab:

Code: Select all
nano /etc/fstab


Comment out the line with /mnt/usb_1, eg:

Code: Select all
#/dev/sda1 /mnt/usb_1 auto defaults,noatime,nofail,x-systemd.automount 0 0


Save and exit (ctrl+x, y, enter)
When I opened fstab I found what you can see in attached immagine4.jpg

I commented the line showed by red arrow.

But the issue came when I tried to save, because of a message indicating not enough space on device.
I closed it and when I opened fstab again, I found it empty, no lines inside. :o
I tried to rewrite the line, coping them from the attached file, but it was impossible to save because of not enough space again.

I rebooted hoping to free space on device but it was worse because now booting errors increased, there is a login error (see immagine5 and immagine6) and I have no write permission (despite I use 'sudo nano /etc/ftab'). Furthermore, putty does not work anymore.

At this point, I think I'm entered in quicksand so I believe it might be better to reinstall. Do you agree?
Or do you have other cartridges to be shot?
Attachments
commentes line
commentes line
booting errors
booting errors
login error
login error
User avatar
Fourdee
Site Admin
Posts: 2788
Joined: Tue Feb 06, 2007 1:36 pm

Re: RPI2 - No space left on device

Post by Fourdee »

But the issue came when I tried to save, because of a message indicating not enough space on device.
Very unlucky :(
francescoG wrote:At this point, I think I'm entered in quicksand so I believe it might be better to reinstall. Do you agree?
Yep, think thats the best solution. We could try and recover, but it could take a long time, and, no guarantee of result.
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal or become a DietPi patron.
francescoG
Posts: 9
Joined: Sat Dec 31, 2016 1:19 pm

Re: RPI2 - No space left on device

Post by francescoG »

francescoG wrote:
At this point, I think I'm entered in quicksand so I believe it might be better to reinstall. Do you agree?


Yep, think thats the best solution. We could try and recover, but it could take a long time, and, no guarantee of result.
I'll reinstall. :cry:
Anyway, thanks so much for the time you have dedicated to solve my iusses.
I have just another more questions:
which is the path of swap file?
User avatar
Fourdee
Site Admin
Posts: 2788
Joined: Tue Feb 06, 2007 1:36 pm

Re: RPI2 - No space left on device

Post by Fourdee »

francescoG wrote: which is the path of swap file?

Code: Select all

/var/swap
If you setup a USB drive, during 1st run, it will be moved automatically to USB drive.

You can check current size and location with:

Code: Select all

/DietPi/dietpi/func/dietpi-set_dphys-swapfile
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal or become a DietPi patron.
Post Reply