You cannot change a partition into an extended one or vice versa Delete it first

    在Linux擴展LVM時,使用fdisk建立分區時,在磁盤上新建擴展分區(邏輯分區),修改分區格式,指定分區類型爲8e時,報錯「You cannot change a partition into an extended one or vice versa Delete it first.」。 具體操做以下所示: linux

[root@get-linux01 ~]# fdisk /dev/sdc
 
The 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): p
 
Disk /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): n
Command action
   e   extended
   p   primary partition (1-4)
e
Partition number (1-4): 1
First cylinder (1-5221, default 1): 
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-5221, default 5221): 
Using default value 5221
 
Command (m for help): t
Selected 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 1
Last cylinder or +size or +sizeM or +sizeK (1-5221, default 5221): 
Using default value 5221
 
Command (m for help): t
Partition 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): p
 
Disk /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): w
The partition table has been altered!
 
Calling ioctl() to re-read partition table.
Syncing disks.

其實出現這個錯誤,是由於分區號(Partition number)號弄錯了(由於必須保留1-4這4個數字給主分區和擴展分區使用,因此邏輯分區的數字必須從5開始)。赤裸裸的要被鄙視啊! 按照下面操做便可解決問題。 app

clip_image001

相關文章
相關標籤/搜索