[root@BigBee barry]# fdisk -l
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0001c2c4
Device Boot Start End Blocks Id System
/dev/sda1 * 63 62974799 31487368+ 83 Linux
/dev/sda2 71569575 976773119 452601772+ 5 Extended
/dev/sda3 62974800 71569574 4297387+ 82 Linux swap / Solaris
/dev/sda5 71569638 155509199 41969781 83 Linux
/dev/sda6 155509263 976773119 410631928+ 83 Linux
Partition table entries are not in disk order
This is easy;
/dev/sda2 and
/dev/sda3 are simply transposed, and both are primary partitions, so follow along in a
terminal, logged in as
root.
[root@fatman ~]# fdisk /dev/sdaCommand (m for help): mCommand action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only) <-- Choose this itemCommand (m for help): xExpert command (m for help): mCommand action
b move beginning of data in a partition
c change number of cylinders
d print the raw data in the partition table
e list extended partitions
f fix partition order <-- Choose this item first g create an IRIX (SGI) partition table
h change number of heads
i change the disk identifier
m print this menu
p print the partition table
q quit without saving changes
r return to main menu <-- Follow with this s change number of sectors/track
v verify the partition table
w write table to disk and exit
Expert command (m for help): fNothing to do. Ordering is correct already.
<-- You won't see this messageExpert command (m for help): rCommand (m for help): mCommand action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table <-- Use to check the fix is correct q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit <-- If so, use this last x extra functionality (experts only)
Command (m for help): pDisk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0001c2c4
Device Boot Start End Blocks Id System
/dev/sda1 * 63 62974799 31487368+ 83 Linux
/dev/sda2 62974800 71569574 4297387+ 82 Linux swap / Solaris
/dev/sda3 71569575 976773119 452601772+ 5 Extended
/dev/sda5 71569638 155509199 41969781 83 Linux
/dev/sda6 155509263 976773119 410631928+ 83 Linux
Command (m for help): wThe partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8 ) or kpartx(8 )
Syncing disks.
[root@fatman ~]#If you have
parted installed, you can run the command
partprobe /dev/sda <Enter> to have the kernel read the new partition table when followed by the
fdisk -l command. The table shown should be as shown above, from within fdisk.