- 论坛徽章:
- 0
|
有文件fstab和blkid两个文件,请把fstab文件中标红的部分,用blkid中对应的uuid替换掉。
cat blkid
/dev/vda1: UUID="9b465eba-ec49-4012-8a7f-50d2143517ec" TYPE="ext4"
/dev/vdb: SEC_TYPE="msdos" LABEL="config-2" UUID="8194-193E" TYPE="vfat"
/dev/vdc1: UUID="e3126851-6fe6-4736-99ae-274b0b3d80dd" TYPE="ext4"
/dev/vdc2: UUID="3c6cf04b-4aa2-4907-809e-0769f9535683" TYPE="ext4"
/dev/vdc3: LABEL="swap-disk" UUID="81feab7e-e77e-441e-8fd6-6ecaa4d735db" TYPE="swap"
/dev/vdc4: UUID="c2f9b53e-9840-4ba2-98e2-87c4d3e1fcf8" TYPE="ext4"
cat fstab
#
# /etc/fstab
# Created by anaconda on Mon Jul 31 16:08:59 2017
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs( , mount( and/or blkid( for more info
#
UUID=9b465eba-ec49-4012-8a7f-50d2143517ec / 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/vdc2 /app ext4 defaults,acl 0 0
/dev/vdc4 /hhly ext4 defaults,acl 0 0
/dev/vdc3 swap swap defaults 0 0
/dev/vdc1 /data ext4 defaults,acl 0 0
需要的结果:
fstab文件内容变成:
#
# /etc/fstab
# Created by anaconda on Mon Jul 31 16:08:59 2017
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs( , mount( and/or blkid( for more info
#
UUID=9b465eba-ec49-4012-8a7f-50d2143517ec / 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=3c6cf04b-4aa2-4907-809e-0769f9535683 /app ext4 defaults,acl 0 0
UUID=c2f9b53e-9840-4ba2-98e2-87c4d3e1fcf8 /hhly ext4 defaults,acl 0 0
UUID=81feab7e-e77e-441e-8fd6-6ecaa4d735db swap swap defaults 0 0
UUID=e3126851-6fe6-4736-99ae-274b0b3d80dd /data ext4 defaults,acl 0 0
|
|