{{tag>Brouillon}} # Notes partitionnement Voir [Partitionnement - Aide mémoire : parted, fdisk, sfdisk, gdisk, sgdisk](https://papy-tux.legtux.org/doc1278/index.html) parted ~~~ parted --script -a optimal /dev/device mklabel gpt mkpart primary 0% 100% parted --script -a optimal /dev/device rm 1 ~~~ ~~~bash luns=$(ls | grep -v control) for i in $luns do parted -a optimal -s -- /dev/mapper/$i mklabel gpt mkpart primary xfs 0% 100% done ~~~ https://pure-storage-openstack-docs.readthedocs.io/en/wallaby/swift/section_swift-partitioning.html You can verify that the partition was successfully created and is properly aligned by using the parted command: ~~~ # parted /dev/mapper/3624a937043be47c12334399b00016d73 align-check optimal 1 1 aligned ~~~ ## sgdisk (compatible GPT) Backup the table of /dev/sda: ~~~bash sgdisk --backup=table /dev/sda ~~~ Restore the table to the new disk: ~~~bash sgdisk --load-backup=table /dev/sdb ~~~ Backup and Restore from /dev/sda to /dev/sdb in one command: ~~~bash sgdisk -R /dev/sdb /dev/sda ~~~ Finally randomize the GUID of all partitions on the disk: ~~~bash sgdisk -G /dev/sdb ~~~ Method for MBR-Tables Copy table from /dev/sda to /dev/sdb: ~~~bash sfdisk -d /dev/sda | sfdisk /dev/sdb ~~~ (Optional)If you don’t see the partitions, read it again: ~~~bash sfdisk -R /dev/sdb ~~~