我正在进行突袭。sda
在安装过程中使用,我刚才复制的分区表sda
来sdb
像这样:
$ sudo sfdisk -dL /dev/sda > partition_table_sda
$ sudo sfdisk /dev/sdb < partition_table_sda
但是,我注意到它sda
具有用于swapspace的uuid,但sdb
没有:
$ sudo blkid
/dev/sda5: UUID="vvvvvvvv-wwww-xxxx-yyyy-zzzzzzzzzzzz" TYPE="swap"
/dev/sda1: UUID="vvvvvvvv-wwww-xxxx-yyyy-zzzzzzzzzzzz" TYPE="ext4"
/dev/sdb1: UUID="vvvvvvvv-wwww-xxxx-yyyy-zzzzzzzzzzzz" TYPE="ext4"
尽管该分区看起来正确,但是只是缺少了uuid:
$ sudo fdisk -l
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0xzzzzzzzz
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 960002047 480000000 83 Linux
/dev/sda2 960004094 976771071 8383489 5 Extended
Partition 2 does not start on physical sector boundary.
/dev/sda5 960004096 976771071 8383488 82 Linux swap / Solaris
Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0xzzzzzzzz
Device Boot Start End Blocks Id System
/dev/sdb1 * 2048 960002047 480000000 83 Linux
/dev/sdb2 960004094 976771071 8383489 5 Extended
Partition 2 does not start on physical sector boundary.
/dev/sdb5 960004096 976771071 8383488 82 Linux swap / Solaris
那么,如何为交换空间分配一个uuid sdb5
?或者,如果已经有uuid,该如何打印出来?