Initializing a brand new disk with "parted"

L'Antre du Tryphon

schedule
2012-06-16 | 17:19h
update
2013-06-08 | 19:25h
person
www.ctheroux.com
domain
www.ctheroux.com

Initializing a brand new disk with “parted”

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

Advertisement

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.

Advertisement

Imprint
Responsible for the content:
www.ctheroux.com
Privacy & Terms of Use:
www.ctheroux.com
Mobile website via:
WordPress AMP Plugin
Last AMPHTML update:
25.04.2024 - 06:07:51
Privacy-Data & cookie usage: