aoutomount无法在Linux / etc / fstab中运行

时间:2017-06-26 08:16:18

标签: linux mount

在/ etc / fstab中添加了Centos 6.9,/ usr01挂载点:

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

当我手动执行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

但/ usr01未在启动时挂载。我尝试过替换auto上的默认值,尝试添加" mount -a"在/etc/rc.local中。没有成功。

更新:尝试使用UUID挂载,但没有成功。 系统重启后:

[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

1 个答案:

答案 0 :(得分:-1)

尝试像uuid这样挂载

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

你可以通过以下方式获得uuid:

sudo blkid /dev/sda4

另一种可能性是你在“/”上使用overlayfs。你的“沙盒”是某种docker实例,还是LIVE-CD?

注意:请参阅有关实际解决方案的评论。问题与docker在容器启动期间不使用/ etc / fstab相关