CraftyPanda

Well-Known Member
Nov 15, 2012
88
2
58
cPanel Access Level
Root Administrator
Hi,

We have just had a situation where the external USB drive for our dedicated server dis mounted without us realizing and the server started backing up to itself at /mnt/usbdrive.

we only realized this when the server ran out of space and things stopped working. So my question is ....

1. Is there any command line that can be run to check if the backup drive is mounted correctly to /mnt/usbdrive
2. Is there any automated way of finding out if the backup drive dismounted?

Regards
Andy
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,218
463
Hello,

You should be able to see if it's correctly mounted by using the "mount" command. EX:

Code:
mount
Also, review /etc/fstab to ensure it's configured correctly for this drive. I'm not aware of any native features with cPanel/WHM that will automatically notify you when a drive is no longer mounted.

Thank you.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,218
463
Hi Michael,

Thank you for the reply. Please can you tell me what the below command actually does? Would this also work?

grep mnt /proc/mounts
This command does not make any changes or resolve any potential issues. It's simply searching the "/proc/mounts" file for the term "mnt", which is the path to your USB drive.

Thank you.
 

CraftyPanda

Well-Known Member
Nov 15, 2012
88
2
58
cPanel Access Level
Root Administrator
Hi Michael,

I ran the mount command and got the below information. When the external back up drive was plugged the first time is was /dev/sdb, i have unplugged it and plugged it back in a second time and now its on /dev/sdc, i have mounted it with 'mount /dev/sdc /mnt/usbdrive' but the below output is now showing two drives mounted to /mnt/usbdrive. Is that going to cause issues?

[email protected] [~]# mount
/dev/mapper/vg_server-lv_root on / type ext4 (rw,usrjquota=quota.user,jqfmt=vfsv0)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw)
/dev/sda1 on /boot type ext4 (rw)
/dev/mapper/vg_server-lv_home on /home type ext4 (rw,usrjquota=quota.user,jqfmt=vfsv0)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
/tmp on /var/tmp type none (rw,noexec,nosuid,bind)
/dev/sdb on /mnt/usbdrive type ext4 (rw)
/dev/sdc on /mnt/usbdrive type ext4 (rw)
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,904
2,218
463
Yes, you should edit /etc/fstab to remove the invalid entry. Note that you may want to consult with your data center when making these types of changes, as it's typically not advised to change partitions/mounts if you are not an experienced system administrator.

Thank you.
 

CraftyPanda

Well-Known Member
Nov 15, 2012
88
2
58
cPanel Access Level
Root Administrator
Michael,

I have just look at my fstab file, I don't see any mention of /dev/sdc. Here is the file contents :


#
# /etc/fstab
# Created by anaconda on Sat Mar 14 20:08:35 2015
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/vg_server-lv_root / ext4 usrjquota=quota.user,jqfmt=vfsv0 1 1
UUID=cd12b383-63d5-49c0-9a10-6b335021ec75 /boot ext4 defaults 1 2
/dev/mapper/vg_server-lv_home /home ext4 usrjquota=quota.user,jqfmt=vfsv0 1 2
/dev/mapper/vg_server-lv_swap swap swap defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
 
Last edited:

CraftyPanda

Well-Known Member
Nov 15, 2012
88
2
58
cPanel Access Level
Root Administrator
No matter, just un mounted it with umount and remounted it correctly, that got rid of the entry. Would still like to know why it isn't showing in fstab though?