- 加入我的QQ群
- 关注我的百家号
扫描下面的二维码,“关注”我的百家号。
在最近一次部署操作系统的工作中,发现自动部署的操作系统,添加新分区后默认使用柱面1为起始,结束柱面为1。该问题常出现在RHCE考场,为了解决该问题,做了如下尝试。
1,尝试,默认SCSI controller为VMware Paravirtual,默认安装rhel6.5。
使用该方法尝试,故障依然发生,更换操作系统版本rhel6下全部存在该问题。
2,尝试,默认SCSI controller为VMware Paravirtual,自定义分区为标准分区安装rhel6.5。
使用该方法尝试,分区后发现start 1 end 64,问题解决。
3,尝试,默认SCSI controller为LSI Logic SAS,默认安装rhel6.5。
使用该方法尝试,分区后发现start 1 end 64,问题解决。
为VM选择不同的SCSI Controller,对应的ddb.geometry也会不同。所以在虚机中观察到的现象是expected behavior。在以下情形,或需手动修改ddb.geometry,
· change the adapter-type of an existing vmdk
· create a vmdk description for a dd-file
· create a vmdk description for a img-file like used by Starwind
· create a vmdk description for a *-flat.vmdk when the original description is lost
注: 关于如何计算ddb.geometry 1.Create a virtual disk descriptor file for use as a base or template. For more information, see Recreating a missing virtual disk (VMDK) header/descriptor file (1002511).
2.Open the descriptor file using a text editor.
3.Modify the CreateType entry as:createType="twoGbMaxExtentSparse"Note: The CreateType value depends on the type of extent used when the virtual disk was created. It can either be twoGbMaxExtentFlat or twoGbMaxExtentSparse.4.Locate the # Extent description section. Replace the contents in this section with a list of your extents:RW 4192256 SPARSE "vmdisk0-s001.vmdk"RW 4192256 SPARSE "vmdisk0-s002.vmdk"RW 2101248 SPARSE "vmdisk0-s003.vmdk"6.Modify the DDB entries as follows:ddb.virtualHWVersion = "4"
ddb.geometry.cylinders = "652"
ddb.geometry.heads = "255"
ddb.geometry.sectors = "63"
ddb.adapterType = "lsilogic"
7.Locate and remove this line from the descriptor file, unless this was originally a thin-provisioned virtual disk before losing the descriptor file:
ddb.thinProvisioned = "1"
因为本身是有红帽技术支持服务的,首先联系了红帽。问题单标题 : fdisk查看sda1分区是从柱面2开始,分sda2的时候会默认使用柱面1。然后红帽回复这是正常的现象。
答复如下:
去查看fdisk命令的man手册显示:
If possible, fdisk will obtain the disk geometry automatically. This is not necessarily the physical disk geometry (indeed, modern disks do not really have anything like a physical geometry, certainly not something that can be described in simplistic Cylinders/Heads/Sectors form), but is the disk geometry that MS-DOS uses for the partition table.
Some versions of MS-DOS create a first partition which does not begin on a cylinder boundary, but on sector 2 of the first cylinder. Partitions beginning in cylinder 1 cannot begin on a cylinder boundary, but this is unlikely to cause difficulty unless you have OS/2 on your machine.
翻译过来大意是:
如有可能,fdisk将自动获取磁盘几何。 这不一定是物理磁盘的几何形状(事实上,现代磁盘实际上没有物理几何形状,当然也不能用简单的圆柱体/磁头/扇区形式来描述),而是MS-DOS使用的磁盘几何形状为分区表。通常默认情况下一切顺利,如果Linux是磁盘上唯一的系统,则不会出现问题。当Linux启动时,它会查看分区表,并尝试推断与其他系统进行良好合作所需的(假)几何。
只要打印出分区表,就会对分区表条目执行一致性检查。 此检查验证物理和逻辑开始点和结束点是否相同,并且分区开始和结束于柱面边界(第一个分区除外)。
某些版本的MS-DOS创建第一个分区,该分区不在圆柱体边界上开始,而是在第一个圆柱体的扇区2上开始;
在fdisk -l的输出节选如下;
Disk /dev/sda: 17.2 GB, 17179869184 bytes
64 heads, 32 sectors/track, 16384 cylinders <===<===计算值向下舍入为整数16384 cylinders。但是,磁盘实际上并没有16384柱面组,这个数字仅仅是从磁盘上使用的LBA寻址方案到MBR分区表中使用的CHS寻址方案的人为映射的结果。 它仅代表必要的地址转换,并不反映任何磁盘几何限制。
Units = cylinders of 2048 * 512 = 1048576 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00065b4f
Device Boot Start End Blocks Id System
/dev/sda1 * 2 501 512000 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 502 16384 16264192 8e Linux LVM
Partition 2 does not end on cylinder boundary.
另外, 日志中也出现了"Partition 1 does not end on cylinder boundary."的信息, 来自fdisk的消息是良性的。 您不需要担心fdisk报告的分区与圆柱边界对齐。
Do I need to be concerned with "partition does not end on cylinder boundary" on Red Hat Enterprise Linux? 转载:(https://itxueguan.com/75.html)
首先,在rhel7中,已经默认显示的是扇区,而不再是rhel6中的柱面了。在使用fdisk在划分分区时间会有提示信息:WARNING: DOS-compatible mode is deprecated. It's strongly recommended to switch off the mode (command 'c') and change display units to sectors (command 'u').在rhel6中可以使用命令fdisk -lcu来显示扇区。
结论
虽然,我觉得红帽回答的问题,就是在扯淡。但是他说这个问题是正常现象,哪就正常现象吧!今天写出来,也就是为了让关注到这特特定情况下的朋友,不要太过于纠结。
让我们在分区的时候快乐的使用fidks -cu /dev/sda,就不会出现该现象。但是,是什么原因导致的该问题呢?依然是个谜。
梦建站 WordPress怎样伪静态 vu
√听说是要必须公众号认证了才可以,这个情况可靠吗?