1

I have two systems with same versions (Debian 11.7, util-linux 2.36.1-8+deb11u1). Why one system shows partition types as UUIDS and the second doesn't and also doesn't recognize that types showing "Empty" as the type?

Background: The second one booted through PXE and I'm setting the partitions table as a copy of the first one. To export from PC1:

$ sfdisk -d /dev/sda > "table-file.tbl"

$ cat "table-file.tbl"

Notice types are UUIDS

device: /dev/sda unit: sectors first-lba: 34 last-lba: 250069646 sector-size: 512 # /boot/efi /dev/sda1 : start= 2048, size= 1048576, type=C12A7328-F81F-11D2-BA4B-00A0C93EC93B, uuid=A454F449-08EA-48E0-BFAD-7D1190CB1DF3 #Main: / /dev/sda2 : start= 1050624, size= 58593280, type=0FC63DAF-8483-4772-8E79-3D69D8477DE4, uuid=46A2A596-C2E9-4D3B-9518-7D1496202576 # Extra partition: /extra /dev/sda3 : start= 59643904, size= 185546752, type=0FC63DAF-8483-4772-8E79-3D69D8477DE4, uuid=FDF1C229-8C35-4324-989F-4EE98B30503B # Swap partition /dev/sda4 : start= 245190656, size= 4878336, type=0657FD6D-A4AB-43C4-84E5-0933C84B4F4F, uuid=67FE00D9-2F09-4C4C-BD07-7129872D48C0 

Moved the file to a shared network dir and used it on PC2:

$ sfdisk /dev/sda < "table-file.tbl" --no-reread; partprove

Now on the new system, fdisk -l reports empty as type:

fdisk -l /dev/sda

Disk /dev/sda: 119.24 GiB, 128035676160 bytes, 250069680 sectors Disk model: TS128GSSD452K-I Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0xf0c0c704 Device Boot Start End Sectors Size Id Type /dev/sda1 2048 1050623 1048576 512M 0 Empty /dev/sda2 1050624 59643903 58593280 27.9G 0 Empty /dev/sda3 59643904 245190655 185546752 88.5G 0 Empty /dev/sda4 245190656 250068991 4878336 2.3G 0 Empty 

On the first system where I retrieve the data, the types are listed as a list with decimal value, name, UUID. On the new system, the list of known partition types hex values. (Linux 83, swap 82, uefi EF...). Types can be seen running:

$ fdisk /dev/sda

PC1:

Command (m for help): l 00 Empty 24 NEC DOS 81 Minix / old Lin bf Solaris 01 FAT12 27 Hidden NTFS Win 82 Linux swap / So c1 DRDOS/sec (FAT- 02 XENIX root 39 Plan 9 83 Linux c4 DRDOS/sec (FAT- 03 XENIX usr 3c PartitionMagic 84 OS/2 hidden or c6 DRDOS/sec (FAT- ... 

PC2:

Command (m for help): l 1 EFI System C12A7328-F81F-11D2-BA4B-00A0C93EC93B 2 MBR partition scheme 024DEE41-33E7-11D3-9D69-0008C781F39F 3 Intel Fast Flash D3BFE2DE-3DAF-11DF-BA40-E3A556D89593 4 BIOS boot 21686148-6449-6E6F-744E-656564454649 5 Sony boot partition F4019732-066E-4E12-8273-346C5641494F 6 Lenovo boot partition BFBFAFE7-A34F-448A-9A5B-6213EB736C22 7 PowerPC PReP boot 9E1A2D38-C612-4316-AA26-8B49521E5A8B ... 
3
  • 1
    Observation: On the new system fdisk -l shows you a dos partition table. GUIDs belong to GUID partition table (GPT). Commented Nov 9, 2023 at 11:00
  • Probably the GPT header is missing. Commented Nov 9, 2023 at 11:04
  • 1
    I don't know sfdisk at all, but after a quick scan of man 8 sfdisk i suspect you need --label gpt when importing your .tbl. What if you use sfdisk --label gpt /dev/sda < "table-file.tbl" --no-reread? Commented Nov 9, 2023 at 11:09

1 Answer 1

1

Different label types use different partition types values. "dos" != "gpt"

Setting the --label as suggested in comments solved the issue:

sfdisk --label gpt /dev/sda < "table-file.tbl" --no-reread

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.