Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I m trying to create a new partition in Linux with parted. I start parted as below.

# parted -a optimal /dev/sda

Below is the current partition table.

Number  Start   End     Size    Type      File system     Flags
 1      1049kB  211MB   210MB   primary   ext4            boot
 2      211MB   10.7GB  10.5GB  primary   ext4
 3      10.7GB  15.9GB  5243MB  primary   linux-swap(v1)
 4      15.9GB  150GB   134GB   extended                  lba

I am getting the below warning when creating the partition.

(parted) mkpart extended 10957 149504
Warning: You requested a partition from 11.0GB to 150GB.
The closest location we can manage is 15.9GB to 150GB.
Is this still acceptable to you?
Yes/No? yes
Warning: WARNING: the kernel failed to re-read the partition table on /dev/sda (Device or resource busy).  As a result, it may not reflect all of your changes until after reboot.
(parted) mkpart logical ext4 10957 149504
Warning: You requested a partition from 11.0GB to 150GB.
The closest location we can manage is 15.9GB to 150GB.
Is this still acceptable to you?
Yes/No? yes
Warning: The resulting partition is not properly aligned for best performance.
Ignore/Cancel?

Why is parted not using the optimal alignment. Help is greatly appreciated.

share|improve this question

1 Answer 1

Try this way:

[root@localhost ~]# fdisk /dev/sda

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
         sectors (command 'u').

Command (m for help): n
First cylinder (2905-10011, default 2905): 
Using default value 2905
Last cylinder, +cylinders or +size{K,M,G} (2905-10011, default 10011): +20M

Command (m for help): t
Partition number (1-6): 6
Hex code (type L to list codes): 83

Command (m for help): p

Disk /dev/sda: 82.3 GB, 82348277760 bytes
255 heads, 63 sectors/track, 10011 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0001501c

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          26      204800   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              26        2637    20971520   83  Linux
/dev/sda3            2637        2898     2097152   82  Linux swap / Solaris
/dev/sda4            2898       10011    57138861+   5  Extended
/dev/sda5            2898        2904       51852+  83  Linux
/dev/sda6            2905        2908       32098+  83  Linux

Command (m for help): w
The 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.

Where:

  • sda is your hard disk

  • n means add a new partition

  • t means change a partition's system id

  • p means print the partition table

  • w means write table to disk and exit

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.