LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   apt-get -f install fails due to "No space left on device" (https://www.linuxquestions.org/questions/linux-newbie-8/apt-get-f-install-fails-due-to-no-space-left-on-device-693490/)

madkayaker 12-28-2008 01:29 PM

apt-get -f install fails due to "No space left on device"
 
While trying to run sudo apt-get -f install to install gettext, I got the following error message:

Code:

dpkg: error processing /var/cache/apt/archives/gettext_0.16.1-1_i386.deb (--unpack):

 failed in buffer_write(fd) (9, ret=-1): backend dpkg-deb during `./usr/share/doc/gettext/NEWS': No space left on device

When I look at my filesystem using df -h, I see the following:
Code:

Filesystem            Size  Used Avail Use% Mounted on
/dev/md0              1.9G  1.9G    0 100% /
tmpfs                189M    0  189M  0% /lib/init/rw
udev                  10M  84K  10M  1% /dev
tmpfs                189M    0  189M  0% /dev/shm
/dev/mapper/okeefmdeb-okeefmdeb_home
                      678G  104G  540G  17% /home
/dev/mapper/okeefmdeb-okeefmdeb_tmp
                      485M  11M  449M  3% /tmp
/dev/mapper/okeefmdeb-okeefmdeb_var
                      4.0G  691M  3.1G  19% /var

My main question is: is /usr a part of the / directory? If so, the filled md0 device (a software RAID 1 device created to hold the root filesystem) would explain the "No space left on device" error.

If this is the problem--my /usr directory has somehow grown to 1.7 GB--is there a way to lower disk usage in that area?

I am currently running Debian Etch 2.6.18-6-686.

Any help would be appreciated...thanks!

acid_kewpie 12-28-2008 01:59 PM

well it has to be there if there's nothing else listed as a mount point for it. with a 680GB /home I have to say that's fairly odd space planning. /usr contains a very significant majority of the installed system, 1.7gb seems a small to medium sized amount of space to be using. you uninstall software you don't wish to use, i tend to run "du -h /usr --max-depth=1" to list the usage of each next directory, go into any unusually high users, go into that directory and repeat until i account for the space. but it's the partition size that's wrong, not the files that are trying to use it.

paulsm4 12-28-2008 02:00 PM

Hi -

1. Your problem is that you've max'ed out your "/dev/md0", your root ("/") filesystem.

2. No, "/usr" isn't necessarily part of the root filesystem. In your case, however, it is. Because that's apparently how it was configured at install time. I can see that because your "df -h" doesn't show "/usr" on its own partition, so it *must* be part of the root partition.

3. To change it, you'd need to:
a) Delete your current "/usr" (simply renaming it would work)
b) Create a new partition for a new "/usr"
c) Mount it
d) Copy your data

'Hope that helps .. PSM

PS:
Acid_Kewpie and I apparently answered at exactly the same time. If you happen to have more physical space on your /dev/md0 device, maybe you can just increase the partition size. You run the risk, unfortunately, of losing everything.

madkayaker 12-28-2008 02:22 PM

Thanks to the both of you for your quick replies. I think what I'm going to do is just reformat the hard drives and reinstall Linux. I only installed about a week ago so there's no precious data on the machine yet, and I'm running a combination of RAID 1 and RAID 5 on the same discs, so it's easier just to reinstall.

Thanks again!

acid_kewpie 12-28-2008 02:53 PM

Whilst I'd try to say otherwise, that probably is the best option all round. If you can afford it i'd suggest a 4gb / and a 16gb /usr or some such.

LinuxAndy2 01-02-2014 02:09 PM

Apt-Get complains about no space left on device that has PLENTY
 
Hello, all

I have a raspberry Pi with a sick samba install. I am trying to set up the packages, but each time I get:
sudo apt-get -f install
> Setting up samba-common (2:3.6.6-6+deb7u2) ...
> sed: couldn't flush /var/run/samba/upgrades/seddUSPtR: No space left on device
> dpkg: error processing samba-common (--configure):
> subprocess installed post-installation script returned error exit status 4

What's especially frustrating, is that when I run df -h, I get:

> /dev/mmcblk0p2 7.2G 1.6G 5.3G 23% /
> /dev/mmcblk0p1 69M 8.2M 61M 12% /boot

/dev/mm... is a SD card, which isn't the fastest way to run the Pi, but it is supported + less hassle than previous attempts at putting / on a USB drive.
ls -la /var/run/samba/upgrades gets me:

drwxrwxrwx 2 root root 80 Jan 2 15:00 .
drwxr-xr-x 4 root root 340 Jan 2 14:59 ..
---------- 1 root root 0 Jan 2 15:00 seddUSPtR
-rw-rw-rw- 1 root root 12171 Jan 2 15:00 smb.conf

dmesg had nothing helpful in it. I can "sudo touch /var/run/samba/upgrades/file", and it works. Can anyone help me out? And why is seddUSPtR so ominously without flags?

TobiSGD 01-02-2014 03:15 PM

The "No space left on device" message can also mean that the filesystem ran out of inodes. What is the output of
Code:

df -i

tredegar 01-02-2014 03:27 PM

Lost flags? My guess is filesystem corruption.
Maybe you should run fsck on your Pi?
And welcome to LQ!

LinuxAndy2 01-05-2014 07:11 PM

Quote:

Originally Posted by TobiSGD (Post 5090812)
The "No space left on device" message can also mean that the filesystem ran out of inodes. What is the output of
Code:

df -i

Output is:

Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/mmcblk0p2 482384 56601 425783 12% /
/dev/mmcblk0p1 0 0 0 - /boot

It doesn't look like I'm out of inodes..

TobiSGD 01-05-2014 09:39 PM

Please post the output of
Code:

cat /proc/mounts
ls -ld /var/run

I suspect that /var/run is actually a tmpfs and you run out of RAM.


All times are GMT -5. The time now is 12:01 PM.