Skip to main content

Questions tagged [sgdisk]

Questions about the command-line component of GPT fdisk (aka gdisk) intended to be used in scripts. For interactive use see gdisk.

2 votes
1 answer
1k views

script to gdisk to create a new partition

I'm trying to script to gdisk to create a new partition of LVM type (for pvcreate) so I typed this but I does not work : diskModelName=yourDiskModel diskSerialNumber=yourDiskSerialNumber ...
SebMa's user avatar
  • 2,473
1 vote
1 answer
236 views

Attempted to replicate partition table to replacement RAID1 disk, but source partition table now empty

I had a disk (/dev/sda) show signs of eventual failure in a RAID1 array, so I failed and then removed it from the array. I then replaced the disk, booted back up, and began the process of replicating ...
Luke Pittman's user avatar
2 votes
3 answers
3k views

sgdisk: Force alignment of end sector

I am trying to get sgdisk to create partitions that align on 1 MB. This is easy for the starting sector (using -a), and for the ending sector, if I choose the size. But if I let sgdisk choose the ...
Ole Tange's user avatar
  • 37.5k
1 vote
1 answer
2k views

How to determine sizes using sgdisk partitioning in bash script

I'm using sgdisk in a bash script similar to this: sgdisk --clear /dev/vda --set-alignment=1 --new 1:34:2047 --typecode 1:EF02 -c 1:"grub" -g /dev/vda sgdisk --new 2:2048:16779263 --typecode 2:8300 -...
BugBuddy's user avatar
  • 678
11 votes
1 answer
8k views

Script to gdisk /dev/sdX and enter expert commands: x, z, y, y - how?

I am creating my first Arch Linux install script, and I want to automate the base installation as in the archwiki or you can find the same instructions but easier to read here: https://www....
Spacecow's user avatar
  • 223
12 votes
1 answer
10k views

How can I quickly copy a GPT partition scheme from one hard drive to another?

On a non GPT partition table I can do sfdisk -d /dev/sda | sfdisk /dev/sdb But sfdisk doesn't support GPT partition tables. What can I use instead? I'm looking for a one or two command solution, not ...
Kris Harper's user avatar