For June, 2012

Initializing a brand new disk with “parted”

No Comments

“parted” is a replacement for “fdisk” of Linux. ┬áIt can handle disks larger than 2 TB. ┬áIssue this command to launch “parted” where /dev/sdL is the disk you want to initialize.

parted /dev/sdL

Create a partition table if it does not exists. For disks larger than 2 TB, you should use the gpt type. You can create such a partition table by issuing this command within “parted”. msdos is the legacy partition table type.

mktable gpt

To create a new partition, mkpart is used to do so. This parted command creates a primary ext4 partition, starting at the first cylinder to the last sector of the disk. You should align your partitions. You can use the parted command align-check to do so.

mkpart primary ext4 1 -1

Quit parted and create your partition using mkfs. For example,

mkfs -t ext4 -m 0 -O dir_index,filetype,sparse_super /dev/sdLX

You can type help to display the list of commands. You can type help followed by a command to display specific help related to this command.

Blue Taste Theme created by Jabox