LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   "file" hostname--vg-root so big (https://www.linuxquestions.org/questions/linux-server-73/file-hostname-vg-root-so-big-4175651539/)

llsastre 04-05-2019 05:29 AM

"file" hostname--vg-root so big
 
Hi,
I have a lubuntu 16.04 server with apache, php, mariadb and moodle 3.2 installed. The name (hostname) of the server is "servweb". It has a 500 Gb SSD hard drive and 24 GB RAM. I have backup copies and I realized that the last backup copy was 450 GB. Checking the files I see that there is a "file" of 430 GB size. The path of this "file" is /dev/mapper/servweb--vg-root but I don't know exactly what it is, if it is a file, a directory or a "reserved space".
I think that if I don't do something about it the system will be blocked, because it will run out of physical space if this "file" continues increasing.
Why is it so big? How can I reduce it, if it is possible? What exactly is this "file"?

Thanks in advance.

berndbausch 04-05-2019 06:15 AM

/dev/mapper/servweb--vg-root should be a device file, not a regular file, and occupy no space at all. Is the 450GB file only in the backup or also on the live system? In the former case, could it be that the device's contents rather than the device file was copied to the backup?

In case the 450GB are occupied on the live system, the ls -l and file commands will be the first step towards understanding its nature.

syg00 04-05-2019 06:19 AM

Run these commands, post (all) the output.
Code:

lsblk -f
df -hT


llsastre 04-05-2019 06:42 AM

administrador@servidorweb:/dev/mapper$ lsblk -f
NAME FSTYPE LABEL UUID MOUNTPOINT
sda
├─sda1 ext2 a367fe48-f667-46be-b9cd-7b8ee630105a /boot
├─sda2
└─sda5 LVM2_member hkeuXr-m1oX-7A0B-KjGg-2GtF-EJHd-4zsyZw
├─servidorweb--vg-root ext4 53381ac9-1503-4e9e-9f1c-3e5c49136817 /
└─servidorweb--vg-swap_1 swap 4cb66bc3-5420-456f-a5ca-7f756e406acd [SWAP]
sdb ext4 CopSeg cbe41dc8-3c9b-4868-b13d-f726f56be1bf
sr0
administrador@servidorweb:/dev/mapper$ df -hT
S. fitxers Tipus Mida En ús Lliure %Ús Muntat a
udev devtmpfs 7,8G 0 7,8G 0% /dev
tmpfs tmpfs 1,6G 154M 1,5G 10% /run
/dev/mapper/servidorweb--vg-root ext4 443G 406G 15G 97% /
tmpfs tmpfs 7,8G 39M 7,8G 1% /dev/shm
tmpfs tmpfs 5,0M 8,0K 5,0M 1% /run/lock
tmpfs tmpfs 7,8G 0 7,8G 0% /sys/fs/cgroup
/dev/sda1 ext2 472M 109M 339M 25% /boot
tmpfs tmpfs 1,6G 12K 1,6G 1% /run/user/1000

llsastre 04-05-2019 06:50 AM

1 Attachment(s)
Copy-paste results:
administrador@servidorweb:/dev/mapper$ lsblk -f
NAME FSTYPE LABEL UUID MOUNTPOINT
sda
├─sda1 ext2 a367fe48-f667-46be-b9cd-7b8ee630105a /boot
├─sda2
└─sda5 LVM2_member hkeuXr-m1oX-7A0B-KjGg-2GtF-EJHd-4zsyZw
├─servidorweb--vg-root ext4 53381ac9-1503-4e9e-9f1c-3e5c49136817 /
└─servidorweb--vg-swap_1 swap 4cb66bc3-5420-456f-a5ca-7f756e406acd [SWAP]
sdb ext4 CopSeg cbe41dc8-3c9b-4868-b13d-f726f56be1bf
sr0
administrador@servidorweb:/dev/mapper$ df -hT
S. fitxers Tipus Mida En ús Lliure %Ús Muntat a
udev devtmpfs 7,8G 0 7,8G 0% /dev
tmpfs tmpfs 1,6G 154M 1,5G 10% /run
/dev/mapper/servidorweb--vg-root ext4 443G 406G 15G 97% /
tmpfs tmpfs 7,8G 39M 7,8G 1% /dev/shm
tmpfs tmpfs 5,0M 8,0K 5,0M 1% /run/lock
tmpfs tmpfs 7,8G 0 7,8G 0% /sys/fs/cgroup
/dev/sda1 ext2 472M 109M 339M 25% /boot
tmpfs tmpfs 1,6G 12K 1,6G 1% /run/user/1000

To view easely I attach a capture image of result.

llsastre 04-05-2019 06:52 AM

Quote:

Originally Posted by berndbausch (Post 5981443)
/dev/mapper/servweb--vg-root should be a device file, not a regular file, and occupy no space at all. Is the 450GB file only in the backup or also on the live system? In the former case, could it be that the device's contents rather than the device file was copied to the backup?

In case the 450GB are occupied on the live system, the ls -l and file commands will be the first step towards understanding its nature.

I think is also on the live system. I posted results of commands suggested by Syg00.

llsastre 04-05-2019 06:55 AM

1 Attachment(s)
Quote:

Originally Posted by syg00 (Post 5981444)
Run these commands, post (all) the output.
Code:

lsblk -f
df -hT



administrador@servidorweb:/dev/mapper$ lsblk -f
NAME FSTYPE LABEL UUID MOUNTPOINT
sda
├─sda1 ext2 a367fe48-f667-46be-b9cd-7b8ee630105a /boot
├─sda2
└─sda5 LVM2_member hkeuXr-m1oX-7A0B-KjGg-2GtF-EJHd-4zsyZw
├─servidorweb--vg-root ext4 53381ac9-1503-4e9e-9f1c-3e5c49136817 /
└─servidorweb--vg-swap_1 swap 4cb66bc3-5420-456f-a5ca-7f756e406acd [SWAP]
sdb ext4 CopSeg cbe41dc8-3c9b-4868-b13d-f726f56be1bf
sr0
administrador@servidorweb:/dev/mapper$ df -hT
S. fitxers Tipus Mida En ús Lliure %Ús Muntat a
udev devtmpfs 7,8G 0 7,8G 0% /dev
tmpfs tmpfs 1,6G 154M 1,5G 10% /run
/dev/mapper/servidorweb--vg-root ext4 443G 406G 15G 97% /
tmpfs tmpfs 7,8G 39M 7,8G 1% /dev/shm
tmpfs tmpfs 5,0M 8,0K 5,0M 1% /run/lock
tmpfs tmpfs 7,8G 0 7,8G 0% /sys/fs/cgroup
/dev/sda1 ext2 472M 109M 339M 25% /boot
tmpfs tmpfs 1,6G 12K 1,6G 1% /run/user/1000

To easely view this results I attach a capture image.

berndbausch 04-05-2019 07:02 AM

Quote:

Originally Posted by llsastre (Post 5981457)
To easely view this results I attach a capture image.

It would be much easier to put code tags around the output.
In any case, most of your root filesystem is filled up. Have a closer look at /dev/mapper/servweb--vg-root.

It would seem that the servidor volume group used to be called servweb, but somehow the device file was turned into a regular file. You can check that with ls -l and file.

I also recommend you have a look at your LVM configuration. As root, run these commands:
Code:

pvs
vgs
lvs

and post their output (don't forget the code tags; if you don't know what I mean, look down about one centimeter).

llsastre 04-05-2019 07:25 AM

Quote:

Originally Posted by berndbausch (Post 5981458)
It would be much easier to put code tags around the output.
In any case, most of your root filesystem is filled up. Have a closer look at /dev/mapper/servweb--vg-root.

It would seem that the servidor volume group used to be called servweb, but somehow the device file was turned into a regular file. You can check that with ls -l and file.

I also recommend you have a look at your LVM configuration. As root, run these commands:
Code:

pvs
vgs
lvs

and post their output (don't forget the code tags; if you don't know what I mean, look down about one centimeter).


Code:

root@servidorweb:/dev/mapper# ls -l /dev/mapper/servidorweb--vg-root
lrwxrwxrwx 1 root root 7 mar 27 09:39 /dev/mapper/servidorweb--vg-root -> ../dm-0
root@servidorweb:/dev/mapper# pvs
  PV        VG            Fmt  Attr PSize  PFree
  /dev/sda5  servidorweb-vg lvm2 a--  465,28g    0
root@servidorweb:/dev/mapper# vgs
  VG            #PV #LV #SN Attr  VSize  VFree
  servidorweb-vg  1  2  0 wz--n- 465,28g    0
root@servidorweb:/dev/mapper# lvs
  LV    VG            Attr      LSize  Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  root  servidorweb-vg -wi-ao---- 449,39g                                                   
  swap_1 servidorweb-vg -wi-ao----  15,89g


berndbausch 04-05-2019 09:10 AM

Quote:

Originally Posted by llsastre (Post 5981464)
Code:

root@servidorweb:/dev/mapper# ls -l /dev/mapper/servidorweb--vg-root
lrwxrwxrwx 1 root root 7 mar 27 09:39 /dev/mapper/servidorweb--vg-root -> ../dm-0


Check /dev/mapper/servweb--vg-root.
Quote:

Code:

root@servidorweb:/dev/mapper# pvs
  PV        VG            Fmt  Attr PSize  PFree
  /dev/sda5  servidorweb-vg lvm2 a--  465,28g    0
root@servidorweb:/dev/mapper# vgs
  VG            #PV #LV #SN Attr  VSize  VFree
  servidorweb-vg  1  2  0 wz--n- 465,28g    0
root@servidorweb:/dev/mapper# lvs
  LV    VG            Attr      LSize  Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  root  servidorweb-vg -wi-ao---- 449,39g                                                   
  swap_1 servidorweb-vg -wi-ao----  15,89g


Since you have no servweb volume group, it should be safe to delete /dev/mapper/servweb--vg-root.

llsastre 04-05-2019 09:27 AM

Quote:

Originally Posted by berndbausch (Post 5981481)
Check /dev/mapper/servweb--vg-root.

Since you have no servweb volume group, it should be safe to delete /dev/mapper/servweb--vg-root.

I've made a mistake with hostname at the beginning of this post, as you have seen. The hostname is servidorweb (sorry).
Must have a servidorweb volume group?
Must I delete this file (/dev/mapper/servidorweb--vg-root)? If yes, does it will continue working fine?
Do you know, or have any idea, how this file is there?
How can this affect to the performance of the server? (I have no idea about this problem. So I need help and ask a lot of questions. I'm very grateful for helping me).

By the way, the directory /dev/mapper contents this:
Code:

root@servidorweb:/dev/mapper# ls -l
total 0
crw------- 1 root root 10, 236 mar 27 09:39 control
lrwxrwxrwx 1 root root      7 mar 27 09:39 servidorweb--vg-root -> ../dm-0
lrwxrwxrwx 1 root root      7 mar 27 09:39 servidorweb--vg-swap_1 -> ../dm-1


michaelk 04-05-2019 09:45 AM

What the OP posted seems normal and I suspect that servweb was in error and should be servidorweb in post #1. Don't delete anything in /dev.

As posted in #2 /dev lives in memory only and any big files would be located elsewhere in the directory tree.

llsastre 04-05-2019 10:06 AM

Quote:

Originally Posted by michaelk (Post 5981490)
What the OP posted seems normal and I suspect that servweb was in error and should be servidorweb in post #1. Don't delete anything in /dev.

As posted in #2 /dev lives in memory only and any big files would be located elsewhere in the directory tree.

This server (servidorweb) has a second hard disk, 2 Tb HDD, for cron local backups (then this backups copy to FTP server by a cron task). This HDD is in /media directory. Now it is about 390 Gb backups. Is it reflected on /dev/mapper/servidorweb--vg-root file perhaps?

michaelk 04-05-2019 10:16 AM

The second disk is sdb which does not appear to be mounted from the posted information. No it is not reflected in vg-root. vg-root is your / filesystem, is part of the LVM and lives within the sda5 partition.

Your root filesystem i.e. / is 97% full. Although there is some reserved space which is not included. If sdb failed to mount then any backups would be written to / instead of sdb. Have you checked /media for files?

llsastre 04-05-2019 11:40 AM

Solved
 
Quote:

Originally Posted by michaelk (Post 5981494)
The second disk is sdb which does not appear to be mounted from the posted information. No it is not reflected in vg-root. vg-root is your / filesystem, is part of the LVM and lives within the sda5 partition.

Your root filesystem i.e. / is 97% full. Although there is some reserved space which is not included. If sdb failed to mount then any backups would be written to / instead of sdb. Have you checked /media for files?

Yes, was it! How silly I am. In /media directory there are two directories: /administrador and /root. Backups copy to /administrador, which is in local SSD, not to /root because sdb was not mounted (I didn't realise it). I've mounted sdb which is in /media/root and I've moved all files from /media/administador to /media/root and I've reviewed script to backup to /media/root and now...
Code:

root@servidorweb:/dev/mapper# df -h
S. fitxers                        Mida En ús Lliure  %Ús Muntat a
udev                              7,8G    0  7,8G  0% /dev
tmpfs                            1,6G  154M  1,5G  10% /run
/dev/mapper/servidorweb--vg-root  443G  59G  362G  14% /
tmpfs                            7,8G  40M  7,8G  1% /dev/shm
tmpfs                            5,0M  8,0K  5,0M  1% /run/lock
tmpfs                            7,8G    0  7,8G  0% /sys/fs/cgroup
/dev/sda1                        472M  109M  339M  25% /boot
tmpfs                            1,6G  12K  1,6G  1% /run/user/1000
/dev/sdb                          1,8T  348G  1,4T  20% /media/root/CopSeg

/dev/mapper/servidorweb--vg-root is now 59 Gb, not 406 Gb.

I'll have to review why sdb was not mounted when reboot system.

Thanks a lot for your help, michaelk, berndbausch and syg00.


All times are GMT -5. The time now is 01:35 AM.