LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   Debian - Dist Upgrade failing due to lack of space in root. (http://www.linuxquestions.org/questions/linux-server-73/debian-dist-upgrade-failing-due-to-lack-of-space-in-root-4175451731/)

Spuddy 02-26-2013 05:03 AM

Debian - Dist Upgrade failing due to lack of space in root.
 
Hi,

We have a dedicated server provided by an external hosting company. We're trying to upgrade but keep getting the following error.

Code:

Now updating linux-image-2.6.32-5-amd64 ..
Installing package(s) with command apt-get -y install linux-image-2.6.32-5-amd64 ..
Reading package lists...
Building dependency tree...
Reading state information...
Suggested packages:
  linux-doc-2.6.32
The following packages will be upgraded:
  linux-image-2.6.32-5-amd64
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 28.8 MB of archives.
After this operation, 119 kB of additional disk space will be used.
Get:1 http://security.debian.org/ squeeze/updates/main linux-image-2.6.32-5-amd64 amd64 2.6.32-48squeeze1 [28.8 MB]
Preconfiguring packages ...
Fetched 28.8 MB in 5s (5348 kB/s)
(Reading database ... 61973 files and directories currently installed.)
Preparing to replace linux-image-2.6.32-5-amd64 2.6.32-46 (using .../linux-image-2.6.32-5-amd64_2.6.32-48squeeze1_amd64.deb) ...
Unpacking replacement linux-image-2.6.32-5-amd64 ...
dpkg: error processing /var/cache/apt/archives/linux-image-2.6.32-5-amd64_2.6.32-48squeeze1_amd64.deb (--unpack):
 failed in write on buffer copy for backend dpkg-deb during `./lib/modules/2.6.32-5-amd64/kernel/drivers/staging/speakup/speakup_dummy.ko': No space left on device
configured to not write apport reports
dpkg-deb: subprocess paste killed by signal (Broken pipe)
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 2.6.32-5-amd64 /boot/vmlinuz-2.6.32-5-amd64
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 2.6.32-5-amd64 /boot/vmlinuz-2.6.32-5-amd64
Errors were encountered while processing:
 /var/cache/apt/archives/linux-image-2.6.32-5-amd64_2.6.32-48squeeze1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
.. install failed!

After a bit of research on the web it seems the root partition is too small for the package to be unpacked and the upgrade to commence.

Any assistance on this? I have tried apt-get clean to no avail.

Code:

fdisk -l

Disk /dev/sda: 250.0 GB, 250000000000 bytes
255 heads, 63 sectors/track, 30394 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00054f22

  Device Boot      Start        End      Blocks  Id  System
/dev/sda1  *          1          43      345366  83  Linux
/dev/sda2              44      30394  243794407+  5  Extended
/dev/sda5              44        651    4883728+  83  Linux
/dev/sda6            652        1016    2931831  83  Linux
/dev/sda7            1017        2495    11880036  82  Linux swap / Solaris
/dev/sda8            2496        2544      393561  83  Linux
/dev/sda9            2545      30394  223705093+  83  Linux

Disk /dev/sdb: 250.0 GB, 250000000000 bytes
255 heads, 63 sectors/track, 30394 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000c6135

  Device Boot      Start        End      Blocks  Id  System
/dev/sdb1  *          1          65      522081  fd  Linux raid autodetect
/dev/sdb2              66        326    2096482+  fd  Linux raid autodetect
/dev/sdb3            327      30394  241521210  fd  Linux raid autodetect
ds357242-2:~# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1            327M  264M  46M  86% /
tmpfs                2.0G    0  2.0G  0% /lib/init/rw
udev                  2.0G  168K  2.0G  1% /dev
tmpfs                2.0G    0  2.0G  0% /dev/shm
/dev/sda9            210G  650M  199G  1% /home
/dev/sda8            373M  11M  343M  3% /tmp
/dev/sda5            4.6G  896M  3.5G  21% /usr
/dev/sda6            2.8G  710M  2.0G  27% /var
ds357242-2:~#


kinneyd 02-26-2013 12:08 PM

Hello,

I would agree / is very small. It seems that apt is running out of space in /var/cache/apt/archives. I think the long term solution would be to make / bigger, but this may not be easily accomplished. You may be able to "borrow" some space from /home by doing a bind mount. I've tested this locally to install a package, but I can't make any promises.

1) Make a directory in /home
# mkdir /home/archives

2) Do a bind mount of /var/cache/apt/archives .
# mount --bind /home/archives /var/cache/apt/archives/

3) Re-run your command to get the new kernel.
# apt-get -y install linux-image-2.6.32-5-amd64

4) Unmount the bind mount, so things are back to normal.
# umount /home/archives

Good luck, and the usual disclaimer :)

TobiSGD 02-26-2013 12:40 PM

Since /var is already on a separate partition with more than enough free space this won't really help.

The first thing to do is to find the space consuming files on that partition:
Code:

du -sxh /*
Please post the output here.

kinneyd 02-26-2013 12:55 PM

Doh, good catch TobiSGD.


All times are GMT -5. The time now is 11:49 AM.