You cannot change a partition into an extended one or vice versa Delete it first
2015-08-07 16:23 潇湘隐者 阅读(6620) 评论(0) 收藏 举报在Linux扩展LVM时,使用fdisk创建分区时,在磁盘上新建扩展分区(逻辑分区),修改分区格式,指定分区类型为8e时,报错“You cannot change a partition into an extended one or vice versa Delete it first.”。 具体操作如下所示:
[root@get-linux01 ~]# fdisk /dev/sdcThe number of cylinders for this disk is set to 5221.There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Command (m for help): pDisk /dev/sdc: 42.9 GB, 42949672960 bytes
255 heads, 63 sectors/track, 5221 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
Command (m for help): nCommand action
e extended
p primary partition (1-4)
e
Partition number (1-4): 1
First cylinder (1-5221, default 1): Using default value 1Last cylinder or +size or +sizeM or +sizeK (1-5221, default 5221): Using default value 5221Command (m for help): tSelected partition 1
Hex code (type L to list codes): 8e
You cannot change a partition into an extended one or vice versa
Delete it first.
Command (m for help): n Command action
l logical (5 or over)
p primary partition (1-4)
l
First cylinder (1-5221, default 1): Using default value 1Last cylinder or +size or +sizeM or +sizeK (1-5221, default 5221): Using default value 5221Command (m for help): tPartition number (1-5): 1
Hex code (type L to list codes): 8e
You cannot change a partition into an extended one or vice versa
Delete it first.
Command (m for help): pDisk /dev/sdc: 42.9 GB, 42949672960 bytes
255 heads, 63 sectors/track, 5221 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdc1 1 5221 41937651 5 Extended
/dev/sdc5 1 5221 41937619+ 83 Linux
Command (m for help): wThe partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
其实出现这个错误,是因为分区号(Partition number)号弄错了(因为必须保留1-4这4个数字给主分区和扩展分区使用,所以逻辑分区的数字必须从5开始)。赤裸裸的要被鄙视啊! 按照下面操作即可解决问题。
扫描上面二维码关注我
如果你真心觉得文章写得不错,而且对你有所帮助,那就不妨帮忙“推荐"一下,您的“推荐”和”打赏“将是我最大的写作动力!
本文版权归作者所有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接.

浙公网安备 33010602011771号