parted - gpt

raid partition

Howto prepare your partitioning in order to create a software raid on top of gpt partitions.

parted /dev/sdb

GNU Parted 2.4
Using /dev/sdb
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted)

Create a fresh gpt label, erase any preexisting partitions:

mklabel gpt
Warning: The existing disk label on /dev/sdb will be destroyed and all data on this disk will be lost. Do you want to
continue?
Yes/No? yes

Use the hole disk to create one software raid partition:

mkpart raid 1MB -1

Check the layout:

 print
Model: ATA WDC WD2003FYYS-0 (scsi)
Disk /dev/sdb: 2000GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start   End     Size    File system  Name  Flags
 1      1049kB  2000GB  2000GB               raid

It seem to be necessary to start with 1MB to avoid these annoying messages “Warning: The resulting partition is not properly aligned for best performance.”

All disks in the arry should have the same layout. We could redo the steps above or copy the layout from drive to drive.

Change the drive to work on:

select /dev/sdc
...

Copy the layout with sgdisk:

# Replicate the main device's partition table (here: sdb) on the specified second  device (here:sdc).
#   Note  that  the replicated  partition  table  is an exact copy, including all GUIDs; if the 
#   device should have its own unique GUIDs, you should use the -G option on the new disk.
 
sgdisk  --replicate=/dev/sdc /dev/sdb
 
# Randomize  the disk's GUID and all partitions' unique GUIDs (but not their partition type code
#   GUIDs). This function may be used after cloning a disk in order to render all GUIDs once again
#   unique.
 
sgdisk --randomize-guids /dev/sdc

alignment (4k sectors)

Howto partition a drive greater than 2TB. I'm going to create a single partition covering the whole available space.

parted --align optimal /dev/sdf
Using /dev/sdf
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) mklabel gpt
(parted) print
Model: ATA WDC WD30EZRX-00M (scsi)
Disk /dev/sdf: 3001GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt

Number  Start  End  Size  File system  Name  Flags

(parted) mkpart xfs 0% 100%
(parted) print
Model: ATA WDC WD30EZRX-00M (scsi)
Disk /dev/sdf: 3001GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt

Number  Start   End     Size    File system  Name  Flags
 1      1049kB  3001GB  3001GB               xfs

(parted) align-check opt
Partition number? 1
1 aligned
(parted)

The last command align-check opt checks whether the alignment of the partition is optimal for the 4k block-size of this drive.

tools/parted.txt · Last modified: 2016-08 by tb
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0 ipv6 ready