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

Source: Internet
Author: User
Tags hex code

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

When Linux expands LVM and fdisk is used to create partitions, new extended partitions (logical partitions) are created on the disk and the partition format is modified. When the partition type is 8e, the error "You cannot change a partition into an extended one or vice versa Delete it first. ". The procedure is as follows:

[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.

In fact, this error occurs because the Partition number is incorrect (because the four numbers 1-4 must be reserved for the primary Partition and extended Partition, therefore, the number of the logical partition must start from 5 ). We need to be despised! Follow the steps below to solve the problem.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.