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

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.

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 )

No space left on device [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 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.

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!

The /run directory: how to create it at first boot to store runtime data [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 read an article about the /run directory on Linux systems.
http://article.gmane.org/gmane.linux.redhat.fedora.devel/146976
This article states that many Linux distributions have agreed that the /run directory is the only clean solution for early-runtime-dir problem. Previously, they put early runtime data in /dev/.XXX or /var/run. But they are now adopting the /run directory for storing early runtime data.
My question: How do they make this change? To be specific, do they change the code in kernel or boot or initscripts?
Take this article (http://article.gmane.org/gmane.linux.redhat.fedora.devel/146976) for example, what are the possible changes that needed to implement this?
The run directory has no special meaning for the kernel itself be it /run or /var/run. From the kernel's point of view it is just a regular directory. For performance reasons since some time ago it is usually mounted as tmpfs file system. The Fedora distribution creates a symbolic link /var/run pointing to /run for backward compatibility:
mount:
tmpfs on /run type tmpfs (rw,nosuid,nodev,seclabel,mode=755)
ls /var:
lrwxrwxrwx. 1 root root 6 Jun 8 15:33 run -> ../run
So actually all 'old' programs and scripts will work. But as the convention changed the packages are also undergoing the update to reflect this. So, with time the need in the /var/run link will dissappear.
To implement this move of /run the init scripts are changed.
/run is created and mounted (usually as a tmpfs filesystem) by the init system of your Linux distribution. For example systemd or OpenRC. The init system runs before any other program.
The kernel doesn't have anything to do with it.

Resources