千家信息网

关于EFI Disk label

发表于:2024-09-29 作者:千家信息网编辑
千家信息网最后更新 2024年09月29日,Solaris 9后,为支持容量大于1 TB的存储设备,在磁盘管理上新引入了EFI(Extensible Firmware Interface)类型的disk label。它与传统的 VTOC(Vol
千家信息网最后更新 2024年09月29日关于EFI Disk labelSolaris 9后,为支持容量大于1 TB的存储设备,在磁盘管理上新引入了EFI(Extensible Firmware Interface)类型的disk label。它与传统的 VTOC(Volume Table of Contents)label 方式有很大不同。我们可以使用 format -e 命令后,再用 label 命令中就可以看到选择 label 的类型菜单。传统的 VTOC label 在 format>label 中被称为 SMI。

与 VTOC Label相比,EFI Label 的主要差异表现为:

可支持容量大于1 TB的磁盘(包括磁盘阵列等逻辑盘).
分区方式改变,可使用的分区为 slices 0-6,其中的 2 分区也是一个普通的可用分区了.
一个分区时不可与其他分区片或label片 (backup label)重叠。EFI label 占用 34 个扇区(sector),因此其它分区的起始扇区必定是从 sector 34开始。也就是说,不再存在从 sector 0开始的分区。
EFI label 不保存磁盘的柱面(cylinder)、磁头(head)、扇区(sector)信息。所以使用EFI label 时,都以扇区号进行操作,分区大小用"块"(block)来表示。
磁盘信息原来保存在备用柱面区域中(alternate cylinders area, 磁盘的最后两个柱面),EFI label 则保存在 slice 8 中。
使用 format 工具修改 partition 时,凡大小为零的分区,都被自动赋予"unassigned"标签(tag);凡大小不为零的分区,则都赋予缺省标签"usr"。分区分好后,可使用partition>change 菜单来修改容量不为零的分区标签(但不可改为"unassigned"标签)。

EFI Label 有一些限制。因此,应该根据下面的限制来考虑,是否应该在应用环境中采用大于1TB的磁盘(及逻辑磁盘)。如果不希望受到 EFI label 带来的局限,那么则不应使用大于1TB的盘(如是阵列逻辑盘,则应将逻辑盘容量划小)。EFI Label的局限主要有:
当前的 SCSI 驱动(ssd)仅支持最多 2 TB 容量。如果需要大于 2 TB 的容量,应采用 Solaris Volume Manager 之类的存储管理工具来创建大容量设备。
某些 Layered software products,虽然声称可以支持 EFI-labeled 磁盘,但在实用中可能无法正确访问 EFI label 盘。
早期 Solaris 版本无法识别 EFI label。
EFI label 不支持 IDE 盘。
EFI label 盘不可做启动盘。
Solaris Management Console 的 Disk Manager 工具不能管理 EFI label 盘,只能使用 format 工具来对 EFI label 盘进行分区,然后再用 Solaris Management Console 的 Enhanced Storage 工具来管理 EFI label 盘上的卷(volume)或磁盘包(disk set)。
EFI 中不可使用重叠分区,因此原来的2分区不再代表全盘。此时,全盘表示方法为 cxtydz.
EFI label 的盘或分区的容量信息中不再出现柱面、磁头等参数,而采用扇区或块为单位。
对 EFI label盘,format 工具中的部分选项/子命令不再可用:
- save 选项不被支持,因为 EFI label 盘不再需要用到 format.dat 中的记录。
- backup 选项不可用,因为磁盘驱动找到 primary label 后即可将它写回到盘上(执行步骤与VOTC方式全然不同了)

下面看看EFI label的实用例子。

例1、EFI label 盘的全盘复制
在原来的VTOC方式中,2分区 (s2) 代表全盘,因此工程师们都习惯使用 dd 来进行全盘复制:

dd if=/dev/rdsk/c0t0d0s2 of=/dev/rdsk/c0t2d0s2 bs=128k

对EFI label 盘的复制则不同了。一是EFI label 没有 s2,二是EFI label 盘上的有一个UUID(Universally Unique Identifer),直接复制会导致两盘的UUID重复,某些软件产品读到重复UUID时会发生数据问题,因此需要在复制后重新生成UUID。
看例子:
1. 全盘数据克隆先:
# dd if=/dev/rdsk/c0t0d0 of=/dev/rdsk/c0t2d0 bs=128k
2. 将源盘的 prtvtoc 输出定向到 fmthard 命令,以生成目标盘的新 label:
# prtvtoc /dev/rdsk/c0t0d0 | fmthard -s - /dev/rdsk/c0t2d0

例2、创建 EFI 或 SMI label
对于小于1TB的盘,既可以使用VTOC label,也可以使用 EFI label。如果使用常规的不带参数的 format 命令,如原盘已 label,那么将不会改变原来的 label 类型;如未 label,则会提示进行 label,采用常规的VTOC类型。如果需要选择指定 label 类型,或需要改变原有的 label 类型,则可以使用 format -e 参数。
我们熟知的常规 format>label 命令的提示是这样的:

# format
Searching for disks...done
……
format> lable
Ready to label disk, continue?

带 -e 参数的format>label 命令则是这样:

# format -e
Searching for disks...done
……
format> label
[0] SMI Label
[1] EFI Label
Specify Label type[0]: 0
Ready to label disk, continue?

上面提供了 label 类型的选择菜单。

例3、使用 format 工具,将一个 1.15 TB 的 EFI label 盘分为 3 个片区

# format
……
partition> modify
Select partitioning base:
0. Current partition table (original)
1. All Free Hog
Choose base (enter number) [0]? 1
Part Tag Flag First Sector Size Last Sector
0 root wm 0 0 0
1 usr wm 0 0 0
2 unassigned wm 0 0 0
3 unassigned wm 0 0 0
4 unassigned wm 0 0 0
5 unassigned wm 0 0 0
6 usr wm 0 0 0
8 reserved wm 2576924638 8.00MB 2576941021
Do you wish to continue creating a new partition
table based on above table[yes]? y
Free Hog partition[6]? 4
Enter size of partition 0 [0b, 34e, 0mb, 0gb, 0tb]:
Enter size of partition 1 [0b, 34e, 0mb, 0gb, 0tb]:
Enter size of partition 2 [0b, 34e, 0mb, 0gb, 0tb]: 400gb
Enter size of partition 3 [0b, 838860834e, 0mb, 0gb, 0tb]: 400gb
Enter size of partition 5 [0b, 1677721634e, 0mb, 0gb, 0tb]:
Enter size of partition 6 [0b, 1677721634e, 0mb, 0gb, 0tb]:
Part Tag Flag First Sector Size Last Sector
0 unassigned wm 0 0 0
1 unassigned wm 0 0 0
2 usr wm 34 400.00GB 838860833
3 usr wm 838860834 400.00GB 1677721633
4 usr wm 1677721634 428.77GB 2576924637
5 unassigned wm 0 0 0
6 unassigned wm 0 0 0
8 reserved wm 2576924638 8.00MB 2576941021
Ready to label disk, continue? yes
partition> q

例4、显示磁盘 label 信息

# prtvtoc /dev/rdsk/c0t0d0s0
* /dev/rdsk/c0t0d0s0 partition map
*
* Dimensions:
* 512 bytes/sector
* 63 sectors/track
* 15 tracks/cylinder
* 945 sectors/cylinder
* 8894 cylinders
* 8892 accessible cylinders
*
* Flags:
* 1: unmountable
* 10: read-only
*
* First Sector Last
* Partition Tag Flags Sector Count Sector Mount Directory
0 2 00 1048950 3381210 4430159 /
1 3 01 0 1048950 1048949
2 5 00 0 8402940 8402939
7 8 00 4430160 3972780 8402939 /export/home

这是一个VTOC label 盘。

# prtvtoc /dev/rdsk/c3t1d0s0
* /dev/rdsk/c3t1d0s0 partition map
*
* Dimensions:
* 512 bytes/sector
* 2479267840 sectors
* 2479267773 accessible sectors
*
* Flags:
* 1: unmountable
* 10: read-only
*
* First Sector Last
* Partition Tag Flags Sector Count Sector Mount Directory
0 2 00 34 262144 262177
1 3 01 262178 262144 524321
6 4 00 524322 2478727100 2479251421
8 11 00 2479251422 16384 2479267805

这是一个 EFI label 盘。


原文地址:http://www.chinaunix.net/old_jh/6/955384.html
0