根据uuid来挂载磁盘
linux-dash
A beautiful web dashboard for Linux
项目地址:https://gitcode.com/gh_mirrors/li/linux-dash
免费下载资源
·
生产上原来有几台机器,是使用传统的/dev/sdX的方式来进行挂载的,经常的在重启以后盘符会变化导致认不到盘的错误
我们推荐使用uuid的方式来进行磁盘的挂载
注:UUID-Universally Unique IDentifiers全局唯一标识符
一、Linux磁盘分区UUID的获取方法
lrwxrwxrwx 1 root root 10 Mar 16 23:28 44c9d244-4b1a-4199-9e68-f4301cca6792 -> ../../sda2
lrwxrwxrwx 1 root root 10 Mar 16 23:28 5a660420-cc92-477a-b4dc-67f507e20673 -> ../../sda1
lrwxrwxrwx 1 root root 10 Mar 16 23:28 8cf3597e-c2c7-4124-905d-499b590f6401 -> ../../sda7
lrwxrwxrwx 1 root root 10 Mar 16 23:33 97027c8c-606b-458b-8b99-8610f18c3a96 -> ../../sdb1
lrwxrwxrwx 1 root root 10 Mar 16 23:28 db522eba-0279-4cdb-9aa8-897e1bcdf46b -> ../../sda6
lrwxrwxrwx 1 root root 10 Mar 16 23:28 eb74c790-af64-466c-ab9c-401e6a2d65f4 -> ../../sda3
[root@12c-rac1 by-uuid]# pwd
/dev/disk/by-uuid
2、通过blkid命令
[root@12c-rac1 by-uuid]# blkid /dev/sdb1
/dev/sdb1: UUID="97027c8c-606b-458b-8b99-8610f18c3a96" TYPE="ext4"
在把挂载点写入开机自动挂载里面就能够使之自动挂载了
[root@12c-rac2 ~]# vi /etc/fstab
#
# /etc/fstab
# Created by anaconda on Wed Dec 24 18:07:14 2014
#
# 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=eb74c790-af64-466c-ab9c-401e6a2d65f4 / ext4 defaults 1 1
UUID=5a660420-cc92-477a-b4dc-67f507e20673 /boot ext4 defaults 1 2
UUID=1bc17da3-d0c1-4baa-be8d-e3ada30bd504 /home ext4 defaults 1 2
#UUID=44c9d244-4b1a-4199-9e68-f4301cca6792 /u01 ext4 defaults 1 2
UUID=8cf3597e-c2c7-4124-905d-499b590f6401 /u02 ext4 defaults 1 2
UUID=db522eba-0279-4cdb-9aa8-897e1bcdf46b 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
UUID=bd115051-f796-422b-945b-f74fe93547d9 /u01 ext4 defaults 0 0
我们推荐使用uuid的方式来进行磁盘的挂载
注:UUID-Universally Unique IDentifiers全局唯一标识符
一、Linux磁盘分区UUID的获取方法
lrwxrwxrwx 1 root root 10 Mar 16 23:28 44c9d244-4b1a-4199-9e68-f4301cca6792 -> ../../sda2
lrwxrwxrwx 1 root root 10 Mar 16 23:28 5a660420-cc92-477a-b4dc-67f507e20673 -> ../../sda1
lrwxrwxrwx 1 root root 10 Mar 16 23:28 8cf3597e-c2c7-4124-905d-499b590f6401 -> ../../sda7
lrwxrwxrwx 1 root root 10 Mar 16 23:33 97027c8c-606b-458b-8b99-8610f18c3a96 -> ../../sdb1
lrwxrwxrwx 1 root root 10 Mar 16 23:28 db522eba-0279-4cdb-9aa8-897e1bcdf46b -> ../../sda6
lrwxrwxrwx 1 root root 10 Mar 16 23:28 eb74c790-af64-466c-ab9c-401e6a2d65f4 -> ../../sda3
[root@12c-rac1 by-uuid]# pwd
/dev/disk/by-uuid
2、通过blkid命令
[root@12c-rac1 by-uuid]# blkid /dev/sdb1
/dev/sdb1: UUID="97027c8c-606b-458b-8b99-8610f18c3a96" TYPE="ext4"
在把挂载点写入开机自动挂载里面就能够使之自动挂载了
[root@12c-rac2 ~]# vi /etc/fstab
#
# /etc/fstab
# Created by anaconda on Wed Dec 24 18:07:14 2014
#
# 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=eb74c790-af64-466c-ab9c-401e6a2d65f4 / ext4 defaults 1 1
UUID=5a660420-cc92-477a-b4dc-67f507e20673 /boot ext4 defaults 1 2
UUID=1bc17da3-d0c1-4baa-be8d-e3ada30bd504 /home ext4 defaults 1 2
#UUID=44c9d244-4b1a-4199-9e68-f4301cca6792 /u01 ext4 defaults 1 2
UUID=8cf3597e-c2c7-4124-905d-499b590f6401 /u02 ext4 defaults 1 2
UUID=db522eba-0279-4cdb-9aa8-897e1bcdf46b 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
UUID=bd115051-f796-422b-945b-f74fe93547d9 /u01 ext4 defaults 0 0
GitHub 加速计划 / li / linux-dash
10.39 K
1.2 K
下载
A beautiful web dashboard for Linux
最近提交(Master分支:2 个月前 )
186a802e
added ecosystem file for PM2 4 年前
5def40a3
Add host customization support for the NodeJS version 4 年前
更多推荐
已为社区贡献3条内容
所有评论(0)