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

lhrbest發表於2016-12-26

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

2015-08-07 16:23 by 瀟湘隱者, 1211 閱讀, 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/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開始)。赤裸裸的要被鄙視啊! 按照下面操作即可解決問題。

clip_image001

作者:瀟湘隱者

本文版權歸作者所有,歡迎轉載,但未經作者同意必須保留此段宣告,且在文章頁面明顯位置給出原文連線.


About Me

...............................................................................................................................

● 本文來自於瀟湘隱者的轉載文章

● 小麥苗雲盤地址:http://blog.itpub.net/26736162/viewspace-1624453/

●  QQ群:230161599     微信群:私聊

● 聯絡我請加QQ好友(642808185),註明新增緣由

● 版權所有,歡迎分享本文,轉載請保留出處

...............................................................................................................................

手機長按下圖識別二維碼或微信客戶端掃描下邊的二維碼來關注小麥苗的微信公眾號:xiaomaimiaolhr,免費學習最實用的資料庫技術。

wpsF8C8.tmp

 

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26736162/viewspace-2131419/,如需轉載,請註明出處,否則將追究法律責任。

相關文章