Used size in root directory is higher than the actual consumption - linux

used size of root directory is 13G as per the df -kh. but when i checked the individual size of the files and folder of root, the size is around 3G. where is the remaining files/folders located in root directory.
Below some outputs for reference,
[root#adair01 opt]# df -kh
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup-lv_root 66G 13G 51G 20% /
[root#adair01 var]# du -sch /*
0 /bin
225M /boot
0 /dev
41M /etc
148K /export
156K /home
0 /lib
0 /lib64
16K /lost+found
4.0K /media
0 /misc
4.0K /mnt
0 /net
1.5G /opt
du: cannot access ‘/proc/30925/task/30925/fd/4’: No such file or directory
du: cannot access ‘/proc/30925/task/30925/fdinfo/4’: No such file or directory
du: cannot access ‘/proc/30925/fd/4’: No such file or directory
du: cannot access ‘/proc/30925/fdinfo/4’: No such file or directory
0 /proc
228K /root
42M /run
0 /sbin
4.0K /srv
0 /sys
1.1M /tmp
1.2G /usr

Related

Can I mount a S3 bucket mounted to Linux EC2 to a Windows EC2 with Samba(smb)?

I have a situation where in I have to mount AWS S3 bucket to a Linux EC2 instance(Linux) using FUSE(S3FS).
Once the Bucket it mounted, it need to be mounted in an Windows EC2 instance with Samba(smb).
I am able to mount the S3 bucket to the Linux EC2 instance using FUSE (S3FS),
but while trying to change content for Samba mount I get the below error:
[centos#sharedfs-23-117 /]$ sudo chcon -t samba_share_t /s3fs-ed/
chcon: failed to change context of ‘/s3fs-ed/’ to ‘system_u:object_r:samba_share_t:s0’: Operation not supported.
Note: My S3 bucket is mounted on /s3fs-ed.
Observation: df -h List all the mounts including the S3 mount:
[centos#sharedfs-23-117 /]$ df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 472M 0 472M 0% /dev
tmpfs 493M 240K 493M 1% /dev/shm
tmpfs 493M 13M 480M 3% /run
tmpfs 493M 0 493M 0% /sys/fs/cgroup
/dev/xvda1 8.0G 1.1G 7.0G 13% /
/dev/xvdb1 8.0G 574M 7.5G 8% /store
tmpfs 99M 0 99M 0% /run/user/1000
s3fs 256T 0 256T 0% /s3fs-ed
But When I try to list the disk by UUID, I do not see the S3 mount being listed:
[centos#sharedfs-23-117 /]$ ls -lha /dev/disk/by-uuid
total 0
drwxr-xr-x. 2 root root 80 Jul 16 09:07 .
drwxr-xr-x. 5 root root 100 Jul 16 09:07 ..
lrwxrwxrwx. 1 root root 11 Jul 16 09:07 388a99ed-9486-4a46-aeb6-06eaf6c47675 -> ../../xvda1
lrwxrwxrwx. 1 root root 11 Jul 16 09:07 fce0d14e-24c6-4f69-b04b-b80041cd636f -> ../../xvdb1
I need help to mount the S3 mount using Samba to the Windows EC2 instance.
Note : Due to some limitation I cannot mount S3 to Windows with rclone (https://rclone.org/).
I have tried disabling the SELinux also , Still the same error
[centos#sharedfs-23-117 /]$ sestatus
SELinux status: disabled
I mount a bucket with s3fs with the following command:
s3fs bucketname /mnt/s3/ -o passwd_file=/etc/.passwd-s3fs -o umask=0000 -o allow_other -o kernel_cache
And I share the folder /mnt/s3 with samba with no problems.
I you still have trouble, share your s3fs mount command, and the smb.conf section you use to share the mount point.

/dev/vda1 is full but cannot find why

I have a server running Centos 7. This is the result of df -h
Filesystem Size Used Avail Use% Mounted on
udev 7.4G 0 7.4G 0% /dev
tmpfs 1.5G 139M 1.4G 10% /run
/dev/vda1 46G 44G 0 100% /
tmpfs 7.4G 0 7.4G 0% /dev/shm
tmpfs 7.4G 0 7.4G 0% /sys/fs/cgroup
/dev/vda15 99M 3.6M 95M 4% /boot/efi
/dev/mapper/LVMVolGroup-DATA_VOLUME 138G 17G 114G 13% /mnt/data
tmpfs 1.5G 0 1.5G 0% /run/user/0
Even if there are 2GB of free space on / , it shows that the filesystem is at 100% of usage, and I can't install new packages because it tells me there's no space left on device.
Besides, if I type sudo du -sh /* | sort -rh | head -15
the result is:
17G /mnt
1.1G /usr
292M /var
208M /root
139M /run
49M /boot
48M /tmp
32M /etc
28K /home
16K /lost+found
12K /anaconda-post.log
4.0K /srv
4.0K /opt
4.0K /media
0 /sys
So it seems that there are no big files filling up the disk, and the sum of the sizes of the directories is not even equal to 44GB.
Additional info: the only service running on the server is Jenkins, but its home is under /mnt/data/jenkins.
How can I solve the problem?
Found the solution.
The problem was related to some deleted files kept open by Jenkins.
Restarting the service the problem was solved.
The problem was related to the system cache/temp storage. Linux system created the cache files and its archive from time to time, especially when some long option is run like DB import or crone job etc.. or sometimes server up from sines long.
Restarting the service or server
so due to that, the cache/ temp files were deleted and the problem was solved.
even in windows, we faced that kind of performance issue when RAM is low, and restarting the system is the primary solution for that.

/media directory not working anymore

I can't automount USB sticks on my linux because I have several problems with /media directory.
Here is my ls -al result on / (I just kept the media and mnt directories for you) :
total 116
drwxr-xr-x 25 root root 4096 juin 13 09:39 .
drwxr-xr-x 25 root root 4096 juin 13 09:39 ..
drwx------ 8 acarbonaro acarbonaro 8192 janv. 1 1970 media
drwxr-xr-x 2 root root 4096 avril 11 2014 mnt
This already seems strange as for other users it is often owned by root.
When I try to sudo chown root:root media it says permission denied.
When I try to sudo chown 755 media it doesn't say anything but when I ls -l after nothing has changed.
The other problem : I don't know why but the media directory is empty I can't find the user directory that used to be in it.
When I plug a USB flash drive, it cannot auto mount. I have to mount it manually in another directory, which is not impossible but clearly not handy.
Thank you for your help.
EDIT:
Here is my df -T result :
Sys. de fichiers Type blocs de 1K Utilisé Disponible Uti% Monté sur
udev devtmpfs 4015584 8 4015576 1% /dev
tmpfs tmpfs 805680 1212 804468 1% /run
/dev/sda1 ext4 115214888 9815468 99523708 9% /
none tmpfs 4 0 4 0% /sys/fs/cgroup
none tmpfs 5120 0 5120 0% /run/lock
none tmpfs 4028392 522580 3505812 13% /run/shm
none tmpfs 102400 600 101800 1% /run/user
/dev/sda2 ext4 130654772 18532260 105462572 15% /home
/dev/sdb2 vfat 14938864 218480 14720384 2% /media
EDIT:
I don't know the answer to my problem, but rebooting reset the /media directory as it was before and it works agian.
I assume the problem was that you have yanked the USB stick out of port without unmounting. UNIX is not very keen to parts of its FS disappearing. Next time, umount it first, then remove.

Git Data backup from temp filder to a new disk (Disk3)

Hey guys I am new to this Git and Linux..please can you let me know, how to copy data backup (here is backup.tar) to a new disk, as my root directory is showing 100%.
my backup path is : /opt/gitlab-6.5.1-0/apps/gitlab/htdocs/tmp/backups$ls
1419371767_gitlab_backup.tar 1428271073_gitlab_backup.tar
1419458174_gitlab_backup.tar 1428357490_gitlab_backup.tar
1419544598_gitlab_backup.tar 1428443884_gitlab_backup.tar
1419631012_gitlab_backup.tar 1428530316_gitlab_backup.tar
1419717436_gitlab_backup.tar 1428616692_gitlab_backup.tar
1419803830_gitlab_backup.tar 1428703211_gitlab_backup.tar
1419890198_gitlab_backup.tar 1428789555_gitlab_backup.tar
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/server4--vg-root 451G 427G 1.2G 100% /
none 4.0K 0 4.0K 0% /sys/fs/cgroup
udev 1.9G 4.0K 1.9G 1% /dev
tmpfs 376M 1016K 375M 1% /run
none 50M 0 50M 0% /run/lock
none 1.9G 4.0K 1.9G 1% /run/shm
none 100M 4.0K 100M 1% /run/user
/dev/sdb1 236M 65M 159M 29% /boot
/dev/sda1 917G 340G 531G 39% /mnt/disk2
/dev/sdc1 917G 75M 871G 1% /mnt/disk3
How do copy to disk3 and remove the backup from the old drive.
Downvoted because it's not a question about git per se, rather a question about Linux...
Anyway, use the mv command to move (or rename) files from one place to another. Or use the cp command to copy them then rm to delete.
Take a look at this tutorial for more help on how to move files around.

ec2 - Do temporary files fill up root ebs volume if there is no ephemeral instance store?

Related to: How do I add instance storage to an existing Windows EC2 instance?
My root 60G ebs volume fill up very quickly, and I can't find the culprit in the file system. My actual files only take up about 10G. I've found out that if I "Stop" and then "Start" the instance, it frees up the remaining 50G.
Note: I started the instance as free micro and then later upgraded to m3.medium. Apparantly micro instances don't have ephemeral storage and you can only add "instance store" upon launching an instance. So I'm thinking I don't have access to ephemeral storage and that it is instead eating up my root ebs volume space with temporary files. Is that possible?
#df -h
Filesystem Size Used Avail Use% Mounted on
/dev/xvda1 59G 47G 13G 80% /
devtmpfs 1.9G 12K 1.9G 1% /dev
tmpfs 1.9G 0 1.9G 0% /dev/shm
#du -sh /* | sort -n
0 /proc
0 /sys
4.0K /local
4.0K /media
4.0K /mnt
4.0K /selinux
4.0K /srv
7.3M /etc
8.0K /tmp
8.1M /bin
8.6G /var
9.7M /sbin
12K /dev
16K /lost+found
17M /root
21M /lib64
24K /run
26M /home
49M /boot
59M /opt
122M /lib
858M /usr
The problem had nothing to do with ephemeral storage. It was that httpd wasn't restarting after logrotate.

Resources