如何修改linux磁盘的uuid
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556删除数据盘并再度分区...
·
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
删除数据盘并再度分区和格式化后,重启会报错,此时如何解决问题?
1)得到uuid
# blkid /dev/sdb1
/dev/sdb1
: UUID=
"294c8a0c-86e1-441f-8e5a-df5a4fc4585a"
TYPE=
"ext4"
或
# ls -l /dev/disk/by-uuid/ |grep sdb
lrwxrwxrwx 1 root root 10 Jul 29 10:26 294c8a0c-86e1-441f-8e5a-df5a4fc4585a -> ../..
/sdb1
2)更新原来的uuid
# mount –o remount,rw /
# vim /etc/fstab
将:
UUID=8fc1e2f4-a6b4-4c5c-99d9-c6ae545a6d63
/data
ext4 defaults 1 2
修改为:
UUID=294c8a0c-86e1-441f-8e5a-df5a4fc4585a
/data
ext4 defaults 1 2
或者可以这样:
echo
"UUID=$(blkid /dev/sdb1 |cut -d'"
' -f2)
/data
ext4 defaults 1 2" >>
/etc/fstab
重启系统:
reboot
fstab中的内容解释请参考
man
中的内容。
The first field, (fs_spec), describes the block special device or remote filesystem
to be mounted.
指定被挂载的设备
The second field, (fs_file), describes the
mount
point
for
the filesystem. For
swap partitions, this field should be specified as ‘none’. If the name of the
mount
point contains spaces these can be escaped as ‘\040’.
指定挂载点
The third field, (fs_vfstype), describes the
type
of the filesystem.
指定fs格式
The fourth field, (fs_mntops), describes the
mount
options associated with the
filesystem.
指定挂载选项
The fifth field, (fs_freq), is used
for
these filesystems by the dump(8)
command
to
determine
which
filesystems need to be dumped. If the fifth field is not present,
a value of zero is returned and dump will assume that the filesystem does not need
to be dumped.
供dump用
The sixth field, (fs_passno), is used by the
fsck
(8) program to determine the order
in
which
filesystem checks are
done
at reboot
time
. The root filesystem should be
specified with a fs_passno of 1, and other filesystems should have a fs_passno of
2. Filesystems within a drive will be checked sequentially, but filesystems on
different drives will be checked at the same
time
to utilize parallelism available
in
the hardware. If the sixth field is not present or zero, a value of zero is
returned and
fsck
will assume that the filesystem does not need to be checked.
供
fsck
用,root是1,其他的fs是2
|
本文转自 pcnk 51CTO博客,原文链接:http://blog.51cto.com/nosmoking/1611824,如需转载请自行联系原作者
更多推荐
已为社区贡献287条内容
所有评论(0)