No space left on device [closed] - linux

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 4 years ago.
Improve this question
I am getting the error "No space left on device" when i tried to scp some files to a centos machine,
tried to check:
[root#...]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol01 18G 18G 0 100% /
And when I do
du -sh / -> it gives only 5G
[... ~]$ df -i /
Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/mapper/VolGroup00-LogVol01
4685824 209516 4476308 5% /
seems like file system is full.
How can i find which one is taking these much size?

Such difference between the output of du -sh and df -h may happen if some large file has been deleted, but is still opened by some process. Check with the command lsof | grep deleted to see which processes have opened descriptors to deleted files. You can restart the process and the space will be freed.

Maybe you are out of inodes. Try df -i
2591792 136322 2455470 6% /home
/dev/sdb1 1887488 1887488 0 100% /data
Disk used 6% but inode table full.

To list processes holding deleted files a linux system which has no lsof, here's my trick:
pushd /proc ; for i in [1-9]* ; do ls -l $i/fd | grep "(deleted)" && (echo -n "used by: " ; ps -p $i | grep -v PID ; echo ) ; done ; popd

You can execute the following commands
lsof / |grep deleted
kill the process id's, which free up the disk space.

Related

Seems like I have lots of space outside of the boot disk but I can't install packages - how do I clear space? Ubuntu GCloud VM [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 11 months ago.
Improve this question
Here is the output of df -H. I keep deleting caches and tmp directories but the problem keeps resurfacing. Any tips on how I might clear out more space?
My home directory is only taking up 3GB - including Python packages and so on, not sure where the 104GB is being taken up. I deleted snapd earlier because all the loop devices were full with vnode tables; any time I try to install a package, for instance, xdiskusage, I get the error `
After this operation, 525 MB of additional disk space will be used.
E: You don't have enough free space in /var/cache/apt/archives/...
df -H
Filesystem Size Used Avail Use% Mounted on
/dev/root 104G 104G 0 100% /
devtmpfs 180G 0 180G 0% /dev
tmpfs 180G 0 180G 0% /dev/shm
tmpfs 36G 3.6G 33G 10% /run
tmpfs 5.3M 0 5.3M 0% /run/lock
tmpfs 180G 0 180G 0% /sys/fs/cgroup
/dev/sda15 110M 5.5M 104M 5% /boot/efi
tmpfs 36G 0 36G 0% /run/user/2002
Warning: you will not be able to log in to Linux when you run out of free disk space. Immediately delete some files or reside the disk larger.
The first step is to delete everything in the /tmp folder. Ignore warnings about not being able to delete files as some processes may have files open.
Next figure out what are the largest files and review which ones can be deleted.
This command will list the 25 largest files:
find / -type f -printf '%s %p\n'| sort -nr | head -25
Be careful what you delete. Do not manually delete files located in the OS directories.
Next list the largest installed packages. Uninstall any that are not required.
dpkg-query --show --showformat='${Installed-Size}\t${Package}\n' | sort -rh | head -25 | awk '{print $1/1024, $2}'
Another item is to review the largest directories on your system:
du -a / | sort -n -r | head -n 25
The final solution(s) are up to you. You must decide which files are not longer required for your system.

write error disk full in EC2 Machine [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 5 years ago.
Improve this question
I have my EC2 linux instance where some softwares are installed.
I downloaded a new zip and was trying to unzip it.
I got this error write error (disk full?). Continue? (y/n/^C) n
The zip is not corrupted and I can unzip it from other instances.
I change instance type from small to medium and then large.Nothing worked.
I ran df -h .
$ df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 16G 56K 16G 1% /dev
tmpfs 16G 0 16G 0% /dev/shm
/dev/xvda1 9.8G 9.7G 0 100% /
I think /dev/xvda1 is culprit. How can i increase the size of this?
What is this /dev/xvda1
It is not a matter of instance type. You must change the volume (EBS) size.
Go to console and select the EBS of that instance , click action dropdown menu , then click modify volume ( A form will appear with the current volume size, increase it )
Try to remove some kilobytes to be able to run (3). rm -rf /tmp/* for example.
Grow/Expand your filesystem :
sudo growpart /dev/xvda 1
sudo resize2fs /dev/xvda1
NOTES :
check Step(1) by lsblk command and check step (3 ) by df -h
Scale down your instance before receiving a huge billing the end of month 😅 ( Let it small as it was )

Why is the default Ubuntu boot partition so small? How can I increase it? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
Recently I created a Ubuntu server. During install I accepted the default options. Installer creates a 236M /boot partition as shown below. After only a few months the partition is full. Is this partition not awfully small? How can I increase it?
$ df -h
Filesystem Size Used Avail Use% Mounted on
udev 16G 4.0K 16G 1% /dev
tmpfs 3.2G 524K 3.2G 1% /run
/dev/mapper/ci--vg-root 95G 80G 11G 89% /
none 4.0K 0 4.0K 0% /sys/fs/cgroup
none 5.0M 0 5.0M 0% /run/lock
none 16G 0 16G 0% /run/shm
none 100M 0 100M 0% /run/user
/dev/sda1 236M 225M 0 100% /boot
You boot partition is probably running out of space as a result kernel updates leaving the old kernels. Just remove the old unused kernels using the following command:
dpkg -l linux-{image,headers}-"[0-9]*" | awk '/^ii/{ print $2}' | grep -v -e `uname -r | cut -f1,2 -d"-"` | grep -e '[0-9]' | xargs sudo apt-get -y purge
Take a look at this question on Ask Ubuntu for more information
If this command fails because of "unmet dependencies" you first have to correct these using apt-get -f install. But that will also fail because of disk space. What you can try is to physically move some of the initrd.img* files out of the /boot directory to free some space for example
sudo mv /boot/initrd.img-3.19.0-25-generic /tmp
sudo mv /boot/initrd...
You can find out current kernel versions using
uname -r
Install GParted Partition Edition and use it for increase or decrease your boot partition
That partition stores the data that is needed before the kernel is loaded (notably the bootloader) and it's size should not change...

Check what partition is used? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I'm working on a SBC6845 card with Linux on it:
I have 4 partitions installed:
Creating 5 MTD partitions on "atmel_nand":
0x000000000000-0x000000100000 : "Factory"
0x000000100000-0x000000300000 : "Kernel1"
0x000000300000-0x000000500000 : "Kernel2"
0x000000500000-0x000008280000 : "Rootfs1"
0x000008280000-0x000010000000 : "Rootfs2"
I want to make a shell script that display which partition is currently used but I don't see how.
the command "df -h" returns:
# df -h
Filesystem Size Used Available Use% Mounted on
/dev/root 178.8G 65.4G 104.3G 39% /
tmpfs 61.7M 0 61.7M 0% /dev/shm
tmpfs 61.7M 36.0K 61.7M 0% /tmp
and also fdisk doesn't work on this system.
Anyone have an idea how to resolve this?
So you want to know on which partition your script is currently located ? df can help you with this! You just have to give it the path to your script as an argument:
#!/bin/sh
df $0 | tail -1 | awk '{print $1}'
And sh myscript.sh gives me: /dev/sda1
Explanations:
df $0 outputs the partition in which myscript.sh is
tail -1 ignores the first line of df (name of the columns)
awk '{print $1}' returns the first column of df, which is the partition
I hope this is what you expected!

How to resolve `FATAL: could not write lock file "postmaster.pid": No space left on device` error? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I have installed postgres 8.4.9 database in my fedora core 14 and deployed an application. It was working fine until today before I tried to restart the system. Now I am unable to start the pgsql. When I am trying to start I am getting the following error
FATAL: could not write lock file "postmaster.pid": No space left on device
I googled but was not able to find the solution for this issue.
Could someone please help in solving this issue?
This is the output of df -kh command:
Filesystem Size Used Avail Use% Mounted on
/dev/vda 9.9G 9.5G 0 100% /
tmpfs 2.0G 88K 2.0G 1% /dev/shm
This is not really a programming question so it should be on superuser.
Short answer -
reboot the system.
If the system comes back up, try:
find / -mtime -3 -size +100000 -exec ls -ls {} \; | sort -n
The largest newest files will be at the bottom of the list. If you can see that the file is not part of an app- a data file for example- remove it. You need at least 5% free space on /.
Long term you must add more disk space, like double or triple what you have.

Resources