If I run these commands:
parted -s /dev/sda \
mklabel gpt \
mkpart primary 1MiB 261MiB \
set 1 esp on \
mkpart primary 261MiB 50GiB \
mkpart primary 50GiB 550GiB \
mkpart primary 550GiB 100%
mkfs.fat -F32 /dev/sda1
yes | mkfs.ext4 /dev/sda2
yes | mkfs.ext4 /dev/sda3
yes | mkfs.ext4 /dev/sda4
I get primary
as name for all those partitions like this:
Model: ATA ST2000LM003 HN-M (scsi)
Disk /dev/sda: 2000GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 1049kB 274MB 273MB fat32 primary boot, esp
2 274MB 53.7GB 53.4GB ext4 primary
3 53.7GB 591GB 537GB ext4 primary
4 591GB 2000GB 1410GB ext4 primary
I don't want these names, how can I avoid such automatic naming?
EDIT
If I change the mkpart
section like this:
parted -s /dev/sda \
mklabel gpt \
mkpart 1MiB 261MiB \
set 1 esp on \
mkpart 261MiB 50GiB \
mkpart 50GiB 550GiB \
mkpart 550GiB 100%
and run the script, I get these:
Error: Invalid number.
mkfs.fat 4.1 (2017-01-24)
mkfs.fat: unable to open /dev/sda1: No such file or directory
mke2fs 1.45.3 (14-Jul-2019)
The file /dev/sda2 does not exist and no size was specified.
mke2fs 1.45.3 (14-Jul-2019)
The file /dev/sda3 does not exist and no size was specified.
mke2fs 1.45.3 (14-Jul-2019)
The file /dev/sda4 does not exist and no size was specified.
EDIT
gparted
can do that:
Here I've removed the label from last partion with gparted
BUT it doesn't show the command how it did that!
name NUMBER name
switch. – ajgringo619 Sep 17 '19 at 00:56Devices
category! On another machine I usedmsdos
instead ofgpt
and withmsdos
I didn't have this issue. – Sep 17 '19 at 00:59mkpart 1MiB 261MiB \
style. – Sep 17 '19 at 06:55cfdisk
I didgpt
partitions several times without any name. I think,cfdisk
actually doesn't have any option for name forgpt
partitions. – Sep 17 '19 at 07:08