简体   繁体   中英

automount is not working from Linux /etc/fstab

Centos 6.9, /usr01 mount point added in /etc/fstab:

UUID=aeb6fc55-7fb2-4a6b-aed8-3dff04c2766e /                       ext4    defaults        1 1
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
/dev/sda4               /usr01  ext3    defaults        0       0

it is working ok when I manually execute mount -a

[root@sandbox ~]# df -h
Filesystem      Size  Used Avail Use% Mounted on
overlay          43G   23G   19G  56% /
tmpfs           7.9G     0  7.9G   0% /dev
tmpfs           7.9G     0  7.9G   0% /sys/fs/cgroup
/dev/sda3        43G   23G   19G  56% /hadoop
/dev/sda3        43G   23G   19G  56% /etc/resolv.conf
/dev/sda3        43G   23G   19G  56% /etc/hostname
/dev/sda3        43G   23G   19G  56% /etc/hosts
shm             7.9G     0  7.9G   0% /dev/shm
tmpfs           7.9G     0  7.9G   0% /dev/shm
/dev/sda4        51G   53M   48G   1% /usr01

but /usr01 is not mounted in boot time. I've tried replace defaults on auto, tried to add "mount -a" in /etc/rc.local. no success.

UPDATE: tried to mount with UUID, no success. after system reboot:

[root@sandbox ~]# df -h
Filesystem      Size  Used Avail Use% Mounted on
overlay          43G   23G   19G  56% /
tmpfs           7.9G     0  7.9G   0% /dev
tmpfs           7.9G     0  7.9G   0% /sys/fs/cgroup
/dev/sda3        43G   23G   19G  56% /hadoop
/dev/sda3        43G   23G   19G  56% /etc/resolv.conf
/dev/sda3        43G   23G   19G  56% /etc/hostname
/dev/sda3        43G   23G   19G  56% /etc/hosts
shm              64M   12K   64M   1% /dev/shm
[root@sandbox ~]# cat /etc/fstab

#
# /etc/fstab
# Created by anaconda on Thu Jun  2 13:42:43 2016
#
# 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
#
UUID=aeb6fc55-7fb2-4a6b-aed8-3dff04c2766e /                       ext4    defaults        1 1
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
UUID=9be134d7-aaa5-4854-aa36-4f8f70b82571               /usr01                  ext3    defaults        0 0
[root@sandbox ~]# blkid /dev/sda4
/dev/sda4: UUID="9be134d7-aaa5-4854-aa36-4f8f70b82571" TYPE="ext3"
[root@sandbox ~]# mount -a
[root@sandbox ~]# df -h
Filesystem      Size  Used Avail Use% Mounted on
overlay          43G   23G   19G  56% /
tmpfs           7.9G     0  7.9G   0% /dev
tmpfs           7.9G     0  7.9G   0% /sys/fs/cgroup
/dev/sda3        43G   23G   19G  56% /hadoop
/dev/sda3        43G   23G   19G  56% /etc/resolv.conf
/dev/sda3        43G   23G   19G  56% /etc/hostname
/dev/sda3        43G   23G   19G  56% /etc/hosts
shm             7.9G     0  7.9G   0% /dev/shm
tmpfs           7.9G     0  7.9G   0% /dev/shm
/dev/sda4        51G   53M   48G   1% /usr01

Try to mount by uuid like this

UUID=12345678-32c3-4f29-b4b6-123456789012  /usr01   ext3  defaults   0 0

You can get the uuid by :

sudo blkid /dev/sda4

Another possibility is that you are using an overlayfs on "/". Is your "sandbox" some sort of docker instance, or LIVE-CD ?

Note : See comments for real solution. The Problem is related to docker not using /etc/fstab during container start

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM