通过UUID挂载Linux文件系统

通过UUID在fstab中挂载分区

  

通常情况,Linux的/etc/fstab文件可能有如下内容:

 # /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump> <pass>
proc            /proc           proc    nodev,noexec,nosuid 0       0
# / was on /dev/sda1 during installation
UUID=8f21495f-bd94-4a88-b433-e52b71475941     /               ext4   errors=remount-ro 0       1
# swap was on /dev/sda2 during installation
UUID=c16a9b20-d020-4741-a1b8-702ba18e82de     none            swap   sw                0       0

查看UUID的命令: blkid

[root@bigops lib]# blkid
/dev/vda1: UUID="7dfba8c2-b302-48dd-9b54-e3f0cc144d6d" TYPE="ext4" 
/dev/vdb: UUID="e3OE6D-KSLx-fZwk-Fypj-S8wC-K5U0-rnUOq7" TYPE="LVM2_member" 
/dev/mapper/data-data1: UUID="f423f733-490b-4be2-b3ea-a9314cd62d57" TYPE="ext4" 
/dev/mapper/data-data: PTTYPE="dos" 

发布了20 篇原创文章 · 获赞 1 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/lwlfox/article/details/104219230