[opensuse] cfdisk/util-linux inserts 2048 sectors between logical partitions, why?
Hello: I have a 250 GB SSD I want to partition with cfdisk. It is from util-linux 2.33.1, default on openSUSE Leap 15.1 I have. I've set a DOS compatible msdos partition scheme. The created partitions in cfdisk are: Device Boot Start End Sectors Size Id Type /dev/sdb1 2048 8390655 8388608 4G 83 Linux /dev/sdb2 8390656 92276735 83886080 40G 83 Linux /dev/sdb3 92276736 176162815 83886080 40G 83 Linux /dev/sdb4 176162816 488397167 312234352 148.9G 5 Extended ├─/dev/sdb5 176164864 218107903 41943040 20G 83 Linux
├─/dev/sdb6 218109952 260052991 41943040 20G 83 Linux ├─/dev/sdb7 260055040 301998079 41943040 20G 83 Linux └─Free space 302000128 488397167 186397040 88.9G
The primary partitions are aligned right after each other. Eg sdb1 ends at sector 8390655 and sdb starts at 8390656. But between logical partitions cfdisk inserts 2048 empty sectors. Eg sdb4 starts at sector 176162816 but sdb5 starts at 176164864. There are 2048 unused sectors between the two. Similarly, sdb5 ends at 218107903 but sdb6 starts at 218109952. Again there are 2048 unused sectors between the two. 1. Why does cfdisk insert these unused spaces between partitions? 2. If I used parted and aligned the extended partitions right after each other (like the primary partitions) would it cause any problem? Thanks in advance, Istvan -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Hello, On Tue, 03 Nov 2020, Istvan Gabor wrote:
I have a 250 GB SSD I want to partition with cfdisk. It is from util-linux 2.33.1, default on openSUSE Leap 15.1 I have.
I've set a DOS compatible msdos partition scheme.
The created partitions in cfdisk are:
Device Boot Start End Sectors Size Id Type /dev/sdb1 2048 8390655 8388608 4G 83 Linux /dev/sdb2 8390656 92276735 83886080 40G 83 Linux /dev/sdb3 92276736 176162815 83886080 40G 83 Linux /dev/sdb4 176162816 488397167 312234352 148.9G 5 Extended +-/dev/sdb5 176164864 218107903 41943040 20G 83 Linux
+-/dev/sdb6 218109952 260052991 41943040 20G 83 Linux +-/dev/sdb7 260055040 301998079 41943040 20G 83 Linux +-Free space 302000128 488397167 186397040 88.9G
The primary partitions are aligned right after each other. Eg sdb1 ends at sector 8390655 and sdb starts at 8390656.
cfdisk and basically all other tools by default create partitions aligned on 1MB-boundaries. And rightly so. On SSD it's basically a must, see https://en.wikipedia.org/wiki/Write_amplification
But between logical partitions cfdisk inserts 2048 empty sectors. Eg sdb4 starts at sector 176162816 but sdb5 starts at 176164864.
That's because sda4 needs 1 sector for the so called "EPBR" (same format as an MBR, and you can also write e.g. a stage1 of grub in the unused first 446 bytes of it) that points to the next logical partition. See: https://en.wikipedia.org/wiki/Extended_boot_record https://en.wikipedia.org/wiki/File:09-02-28-ebr-entry-2.png https://en.wikipedia.org/wiki/Disk_partitioning https://en.wikipedia.org/wiki/Partition_alignment And a start of sdb5 at 176162817 would not be aligned, and a start 176164864 is the next aligned-on-1MB possibility.
There are 2048 unused sectors between the two.
Nope. 2047!
Similarly, sdb5 ends at 218107903 but sdb6 starts at 218109952.
That is because of how the DOS extended partition works, basically it's a chain of extended partition, so _EACH AND EVERY ONE_ logical partition MUST contain another "EPBR", same thing as with sda4...
Again there are 2048 unused sectors between the two.
Nope, Again, there are 2047 only unused sectors, and the next aligned is used.
1. Why does cfdisk insert these unused spaces between partitions?
Because it must, see above.
2. If I used parted and aligned the extended partitions right after each other (like the primary partitions) would it cause any problem?
It's not possible. And if you did squeeze them to be unaligned (e.g. start at the next possible sector after the EPBR), then (on Flash) (write-)performance and durability would suffer quite a lot. HTH, -dnh -- Photons have mass!!?? I didn't even know they were Catholic... -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Tue, 3 Nov 2020 22:44:16 +0100 időpontban David Haller írta:
Hello,
On Tue, 03 Nov 2020, Istvan Gabor wrote:
I have a 250 GB SSD I want to partition with cfdisk. It is from util-linux 2.33.1, default on openSUSE Leap 15.1 I have.
I've set a DOS compatible msdos partition scheme.
The created partitions in cfdisk are:
Device Boot Start End Sectors Size Id Type /dev/sdb1 2048 8390655 8388608 4G 83 Linux /dev/sdb2 8390656 92276735 83886080 40G 83 Linux /dev/sdb3 92276736 176162815 83886080 40G 83 Linux /dev/sdb4 176162816 488397167 312234352 148.9G 5 Extended +-/dev/sdb5 176164864 218107903 41943040 20G 83 Linux
+-/dev/sdb6 218109952 260052991 41943040 20G 83 Linux +-/dev/sdb7 260055040 301998079 41943040 20G 83 Linux +-Free space 302000128 488397167 186397040 88.9G
The primary partitions are aligned right after each other. Eg sdb1 ends at sector 8390655 and sdb starts at 8390656.
cfdisk and basically all other tools by default create partitions aligned on 1MB-boundaries. And rightly so. On SSD it's basically a must, see https://en.wikipedia.org/wiki/Write_amplification
But between logical partitions cfdisk inserts 2048 empty sectors. Eg sdb4 starts at sector 176162816 but sdb5 starts at 176164864.
That's because sda4 needs 1 sector for the so called "EPBR" (same format as an MBR, and you can also write e.g. a stage1 of grub in the unused first 446 bytes of it) that points to the next logical partition.
See: https://en.wikipedia.org/wiki/Extended_boot_record https://en.wikipedia.org/wiki/File:09-02-28-ebr-entry-2.png https://en.wikipedia.org/wiki/Disk_partitioning https://en.wikipedia.org/wiki/Partition_alignment
And a start of sdb5 at 176162817 would not be aligned, and a start 176164864 is the next aligned-on-1MB possibility.
There are 2048 unused sectors between the two.
Nope. 2047!
Similarly, sdb5 ends at 218107903 but sdb6 starts at 218109952.
That is because of how the DOS extended partition works, basically it's a chain of extended partition, so _EACH AND EVERY ONE_ logical partition MUST contain another "EPBR", same thing as with sda4...
Again there are 2048 unused sectors between the two.
Nope, Again, there are 2047 only unused sectors, and the next aligned is used.
1. Why does cfdisk insert these unused spaces between partitions?
Because it must, see above.
2. If I used parted and aligned the extended partitions right after each other (like the primary partitions) would it cause any problem?
It's not possible. And if you did squeeze them to be unaligned (e.g. start at the next possible sector after the EPBR), then (on Flash) (write-)performance and durability would suffer quite a lot.
HTH, -dnh
David, thanks for the detailed explanation. I did now about the 1MB boundary, but did not know about the 1 sector EPBR which explains the 2048 sector/1MB empty space (OK only 2047 sectors are emtpy). Thanks again, Istvan -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 03/11/2020 21.31, Istvan Gabor wrote:
Hello:
I have a 250 GB SSD I want to partition with cfdisk. It is from util-linux 2.33.1, default on openSUSE Leap 15.1 I have.
I've set a DOS compatible msdos partition scheme.
Why not GPT? All partitions will be primaries and you avoid part of the problem. Works fine (on Linux) even on old computers. -- Cheers / Saludos, Carlos E. R. (from 15.1 x86_64 at Telcontar)
On 2020-11-03 6:19 p.m., Carlos E.R. wrote:
Why not GPT? All partitions will be primaries and you avoid part of the problem. Works fine (on Linux) even on old computers.
Do we still have primary and extended partitions with UEFI??? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Am Mittwoch, 4. November 2020, 15:38:43 CET schrieb James Knott:
On 2020-11-03 6:19 p.m., Carlos E.R. wrote:
Why not GPT? All partitions will be primaries and you avoid part of the problem. Works fine (on Linux) even on old computers.
Do we still have primary and extended partitions with UEFI??? We can have. It is a limitation of the Windows bootloader that you have to use GPT on the boot disk when booting in UEFI mode. And that booting in legacy BIOS (CSM) mode requires a MBR partition schema. Booting Linux doesn't have these restrictions. And on non bootable disks you can use MBR unless you hit the 2 TiB limit ( even with Windows)
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 2020-11-04 10:31 a.m., Markus Koßmann wrote:
Am Mittwoch, 4. November 2020, 15:38:43 CET schrieb James Knott:
On 2020-11-03 6:19 p.m., Carlos E.R. wrote:
Why not GPT? All partitions will be primaries and you avoid part of the problem. Works fine (on Linux) even on old computers. Do we still have primary and extended partitions with UEFI??? We can have. It is a limitation of the Windows bootloader that you have to use GPT on the boot disk when booting in UEFI mode. And that booting in legacy BIOS (CSM) mode requires a MBR partition schema. Booting Linux doesn't have these restrictions. And on non bootable disks you can use MBR unless you hit the 2 TiB limit ( even with Windows)
In my computers, I have the choice of legacy or UEFI booting. If I go legacy, I know I will need an extended partition, if I want more than 4 partitions. Does that not disappear with UEFI? Are you saying the boot loader in any recent version of Windows will still require that? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Am Mittwoch, 4. November 2020, 16:41:30 CET schrieb James Knott:
I know I will need an extended partition, if I want more than 4 partitions. Does that not disappear with UEFI? No.It goes away, if/because you are using GPT as partition schema. And not because you are booting in UEFI mode.
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 04/11/2020 16.41, James Knott wrote:
On 2020-11-04 10:31 a.m., Markus Koßmann wrote:
On 2020-11-03 6:19 p.m., Carlos E.R. wrote:
Why not GPT? All partitions will be primaries and you avoid part of the problem. Works fine (on Linux) even on old computers. Do we still have primary and extended partitions with UEFI??? We can have. It is a limitation of the Windows bootloader that you have to use GPT on the boot disk when booting in UEFI mode. And that booting in legacy BIOS (CSM) mode requires a MBR partition schema. Booting Linux doesn't have these restrictions. And on non bootable disks you can use MBR unless you hit the 2 TiB
Am Mittwoch, 4. November 2020, 15:38:43 CET schrieb James Knott: limit ( even with Windows)
In my computers, I have the choice of legacy or UEFI booting. If I go legacy, I know I will need an extended partition, if I want more than 4 partitions. Does that not disappear with UEFI? Are you saying the boot loader in any recent version of Windows will still require that?
With Linux, you can boot an old machine that only has BIOS with a disk formatted with GPT, because it has a protective MBR that works (the old bios does not understand GPT). The disk should not be over 2 GB, but I have not tried more. Once Linux boots, it can use all the partitions in the disk. Maybe even before booting, I'm not fully sure. -- Cheers / Saludos, Carlos E. R. (from 15.1 x86_64 at Telcontar)
Le 04/11/2020 à 16:31, Markus Koßmann a écrit :
Am Mittwoch, 4. November 2020, 15:38:43 CET schrieb James Knott:
Do we still have primary and extended partitions with UEFI??? We can have.
Booting Linux doesn't have these restrictions.
and the linux (openSUSE at least) install is exactly the same. One can boot with MSDOS system, use yast to add grub-efi and later boot as uefi jdd -- http://dodin.org -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Wed, 4 Nov 2020 00:19:30 +0100 időpontban Carlos E.R. írta:
On 03/11/2020 21.31, Istvan Gabor wrote:
Hello: I have a 250 GB SSD I want to partition with cfdisk. It is from util-linux 2.33.1, default on openSUSE Leap 15.1 I have. I've set a DOS compatible msdos partition scheme.
Why not GPT? All partitions will be primaries and you avoid part of the problem. Works fine (on Linux) even on old computers.
That's a valid question. I guess only bad old habit. I used to do it like that. Istvan -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Istvan Gabor composed on 2020-11-03 21:31 (UTC+0100):
1. Why does cfdisk insert these unused spaces between partitions?
I have no idea. In never use cfdisk (or parted, or fdisk, or gdisk, or gparted) to write anything. I only ever use DFSee for partition writes since around the beginning of the century.
2. If I used parted and aligned the extended partitions right after each other (like the primary partitions) would it cause any problem?
I never have any problem from not having gaps. The only gaps I ever have are intended freespace, wasted end of disk space, and the standard 1MiB at the front of "aligned" disks. The following is the exact partitioning I have in place in multiple PCs: <html> <head> </head> <body> <pre style="font: small monospace"># excerpts of log from DFSee OS version : Linux 4.12.14 (x86_64) openSUSE Leap 15.1 Current user : root on ara88 using TERM=linux 1 Phys 1 /dev/sda Model=SPCCSolidStateDisk, FwRev=SBFQE1.2, SerialNo=SCRW20030706A15427 Disk 1 L-Geo from: GPT table, likely 1-MiB cylinders (GPT guard present in MBR) Disk 1 forcing : cylinders from 31130 to 244199 Disk 1 forcing : heads from 255 to 64 Disk 1 forcing : sectors from 63 to 32 L-Geo Disk 1 Cyl : 244199 H: 64 S:32 Bps:512 Size:0x1DCF3800 = 238.5 GiB S-Geo Disk 1 Cyl : 31130 H:255 S:63 Bps:512 Size:0x1DCEF91A = 238.5 GiB MBR crc 054b4eb9 : 0x0c8ca699 = DFSee generic bootcode, US-English, I13X DFSee Linux 16.7 : Executing: fdisk -r- -w- Command timestamp : Saturday 2020-10-10 22:53:14 +---+--+--+-----------------+--------+--------+-----------+----------------------------------------+-----------+ |ID |ux|Dr|Type, description|Format |Related |VolumeLabel|OS2-LVM/BM / GPT / Crypt / additional in| Size MiB | +--[/dev/sda GPT disk 1]--------+--------+-----------[Model=SPCCSolidState]-------------------+-----------+ |01 | | |Fsp + GPT hdr/pta|-- -- --|-- -- --|- - - - - -|Size 0x7de sectors | 1.0| |01 | 1| |EFI System (ESP)|FAT32 |mkfs.fat|ZD8P01ESP |ZD8P01 EFI System (ESP) | 320.0| |02 | 2| |Linux Swap |SWAP |LinuxV1 |SWAPSPACE2 |ZD8P02 Linux Swap | 1752.0| |03 | 3| |Linux Data |EXT2 |Linux |zd8p03res |ZD8P03 Linux reservation | 400.0| |04 | 4| |Linux Data |EXT4 |Linux |zd8p04usrlc|ZD8P04 Linux /usr/local | 4000.0| |05 | 5| |Linux Data |EXT4 |Linux |zd8p05home |ZD8P05 Linux /home | 6400.0| |06 | 6| |Linux Data |EXT4 |Linux |zd8p06pub |ZD8P06 Linux /pub | 12600.0| |07 | 7| |Linux Data |EXT4 |Linux |zd8p07stw |ZD8P07 openSUSE Tumbleweed | 8000.0| |08 | 8| |Linux Data |EXT4 |Linux |zd8p08s150 |ZD8P08 openSUSE 15.0 | 8000.0| |09 | 9| |Linux Data |EXT4 |Linux |zd8p09s151 |ZD8P09 openSUSE 15.1 | 8000.0| |10 |10| |Linux Data |EXT4 |Linux |zd8p10deb10|ZD8P10 Debian 10 Buster | 8000.0| |11 |11| |Linux Data |EXT4 |Linux |zd8p11s152 |ZD8P11 openSUSE 15.2 | 8000.0| |12 |12| |Linux Data |EXT4 |Linux |zd8p12ub200|ZD8P12 Tubuntu 2004 Focal | 8000.0| |13 |13| |Linux Data |EXT4 |Linux |zd8p13mint1|ZD8P13 LinuxMint 19 XFCE | 8000.0| |14 |14| |Linux Data |EXT4 |Linux |zd8p14deb11|ZD8P14 Debian 11 Bullseye | 8000.0| |15 |15| |Linux Data |EXT4 |Linux |zd8p15f32 |ZD8P15 Fedora 32 | 8000.0| |16 |16| |Linux Data |EXT4 |Linux |zd8p16f33 |ZD8P16 Fedora 33 | 8000.0| |17 |17| |Linux Data |EXT4 |Linux |zd8p17ub180|ZD8P17 Tubuntu 1804 Bionic | 8000.0| |18 |18| |Linux Data |unknown |Linux | |New: Linux Data | 8000.0| |19 | | |Fsp + GPT pta/hdr|-- -- --|-- -- --|- - - - - -|Size 0xefb2a8f sectors | 122725.3| DFSee Linux 16.7 : Executing: part -n Command timestamp : Saturday 2020-10-10 22:53:19 +---+--+--+-----------------+----------+----------+-------------------+----------+-----------+ |ID |ux|Dr|Type, description|Begin Sect|End sector| Cylinder range | Sectors | Size MiB | +--[/dev/sda GPT disk 1]----------+----------+-------------------[Model=SPCCSolidState]-+ |01 | | |Fsp + GPT hdr/pta| 22| 7ff| 0 - 0| 7de| 1.0| |01 | 1| |EFI System (ESP)| 800| a07ff| 1 - 320| a0000| 320.0| |02 | 2| |Linux Swap | a0800| 40c7ff| 321 - 2072| 36c000| 1752.0| |03 | 3| |Linux Data | 40c800| 4d47ff| 2073 - 2472| c8000| 400.0| |04 | 4| |Linux Data | 4d4800| ca47ff| 2473 - 6472| 7d0000| 4000.0| |05 | 5| |Linux Data | ca4800| 19247ff| 6473 - 12872| c80000| 6400.0| |06 | 6| |Linux Data | 1924800| 31c07ff| 12873 - 25472| 189c000| 12600.0| |07 | 7| |Linux Data | 31c0800| 41607ff| 25473 - 33472| fa0000| 8000.0| |08 | 8| |Linux Data | 4160800| 51007ff| 33473 - 41472| fa0000| 8000.0| |09 | 9| |Linux Data | 5100800| 60a07ff| 41473 - 49472| fa0000| 8000.0| |10 |10| |Linux Data | 60a0800| 70407ff| 49473 - 57472| fa0000| 8000.0| |11 |11| |Linux Data | 7040800| 7fe07ff| 57473 - 65472| fa0000| 8000.0| |12 |12| |Linux Data | 7fe0800| 8f807ff| 65473 - 73472| fa0000| 8000.0| |13 |13| |Linux Data | 8f80800| 9f207ff| 73473 - 81472| fa0000| 8000.0| |14 |14| |Linux Data | 9f20800| aec07ff| 81473 - 89472| fa0000| 8000.0| |15 |15| |Linux Data | aec0800| be607ff| 89473 - 97472| fa0000| 8000.0| |16 |16| |Linux Data | be60800| ce007ff| 97473 - 105472| fa0000| 8000.0| |17 |17| |Linux Data | ce00800| dda07ff| 105473 - 113472| fa0000| 8000.0| |18 |18| |Linux Data | dda0800| ed407ff| 113473 - 121472| fa0000| 8000.0| |19 | | |Fsp + GPT pta/hdr| ed40800| 1dcf328e| 121473 - 244198| efb2a8f| 122725.3| 0x0800 = decimal 2048 X 512BPS = 1 MiB 8000 mebibytes = 8.39 gigabytes # parted -l Model: ATA SPCCSolidStateDi (scsi) Disk /dev/sda: 256GB Sector size (logical/physical): 512B/512B Partition Table: gpt Disk Flags: Number Start End Size File system Name Flags 1 1049kB 337MB 336MB fat32 ZD8P01 EFI System (ESP) boot, esp 2 337MB 2174MB 1837MB linux-swap(v1) ZD8P02 Linux Swap swap 3 2174MB 2593MB 419MB ext2 ZD8P03 Linux reservation 4 2593MB 6787MB 4194MB ext4 ZD8P04 Linux /usr/local 5 6787MB 13.5GB 6711MB ext4 ZD8P05 Linux /home 6 13.5GB 26.7GB 13.2GB ext4 ZD8P06 Linux /pub 7 26.7GB 35.1GB 8389MB ext4 ZD8P07 openSUSE Tumbleweed 8 35.1GB 43.5GB 8389MB ext4 ZD8P08 openSUSE 15.0 9 43.5GB 51.9GB 8389MB ext4 ZD8P09 openSUSE 15.1 10 51.9GB 60.3GB 8389MB ext4 ZD8P10 Debian 10 Buster 11 60.3GB 68.7GB 8389MB ext4 ZD8P11 openSUSE 15.2 12 68.7GB 77.0GB 8389MB ext4 ZD8P12 Tubuntu 2004 Focal 13 77.0GB 85.4GB 8389MB ext4 ZD8P13 LinuxMint 19 XFCE 14 85.4GB 93.8GB 8389MB ext4 ZD8P14 Debian 11 Bullseye 15 93.8GB 102GB 8389MB ext4 ZD8P15 Fedora 32 16 102GB 111GB 8389MB ext4 ZD8P16 Fedora 33 17 111GB 119GB 8389MB ext4 ZD8P17 Tubuntu 1804 Bionic 18 119GB 127GB 8389MB ext3 ZD8P18 openSUSE 15.2.1 # fdisk -l Disk /dev/sda: 238.5 GiB, 256060514304 bytes, 500118192 sectors Disk model: SPCCSolidStateDi 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: gpt Disk identifier: 5B330B05-5C88-4DF5-8359-67FF3E52CDC4 Device Start End Sectors Size Type /dev/sda1 2048 657407 655360 320M EFI System /dev/sda2 657408 4245503 3588096 1.7G Linux swap /dev/sda3 4245504 5064703 819200 400M Linux filesystem /dev/sda4 5064704 13256703 8192000 3.9G Linux filesystem /dev/sda5 13256704 26363903 13107200 6.3G Linux filesystem /dev/sda6 26363904 52168703 25804800 12.3G Linux filesystem /dev/sda7 52168704 68552703 16384000 7.8G Linux filesystem /dev/sda8 68552704 84936703 16384000 7.8G Linux filesystem /dev/sda9 84936704 101320703 16384000 7.8G Linux filesystem /dev/sda10 101320704 117704703 16384000 7.8G Linux filesystem /dev/sda11 117704704 134088703 16384000 7.8G Linux filesystem /dev/sda12 134088704 150472703 16384000 7.8G Linux filesystem /dev/sda13 150472704 166856703 16384000 7.8G Linux filesystem /dev/sda14 166856704 183240703 16384000 7.8G Linux filesystem /dev/sda15 183240704 199624703 16384000 7.8G Linux filesystem /dev/sda16 199624704 216008703 16384000 7.8G Linux filesystem /dev/sda17 216008704 232392703 16384000 7.8G Linux filesystem /dev/sda18 232392704 248776703 16384000 7.8G Linux filesystem # gdisk -l /dev/sda GPT fdisk (gdisk) version 1.0.1 Partition table scan: MBR: protective BSD: not present APM: not present GPT: present Found valid GPT with protective MBR; using GPT. Disk /dev/sda: 500118192 sectors, 238.5 GiB Logical sector size: 512 bytes Disk identifier (GUID): 5B330B05-5C88-4DF5-8359-67FF3E52CDC4 Partition table holds up to 128 entries First usable sector is 34, last usable sector is 500118158 Partitions will be aligned on 2048-sector boundaries Total free space is 251343469 sectors (119.8 GiB) Number Start (sector) End (sector) Size Code Name 1 2048 657407 320.0 MiB EF00 ZD8P01 EFI System (... 2 657408 4245503 1.7 GiB 8200 ZD8P02 Linux Swap 3 4245504 5064703 400.0 MiB 8300 ZD8P03 Linux reserv... 4 5064704 13256703 3.9 GiB 8300 ZD8P04 Linux /usr/l... 5 13256704 26363903 6.3 GiB 8300 ZD8P05 Linux /home 6 26363904 52168703 12.3 GiB 8300 ZD8P06 Linux /pub 7 52168704 68552703 7.8 GiB 8300 ZD8P07 openSUSE Tum... 8 68552704 84936703 7.8 GiB 8300 ZD8P08 openSUSE 15.0 9 84936704 101320703 7.8 GiB 8300 ZD8P09 openSUSE 15.1 10 101320704 117704703 7.8 GiB 8300 ZD8P10 Debian 10 Bu... 11 117704704 134088703 7.8 GiB 8300 ZD8P11 openSUSE 15.2 12 134088704 150472703 7.8 GiB 8300 ZD8P12 Tubuntu 2004... 13 150472704 166856703 7.8 GiB 8300 ZD8P13 LinuxMint 19... 14 166856704 183240703 7.8 GiB 8300 ZD8P14 Debian 11 Bu... 15 183240704 199624703 7.8 GiB 8300 ZD8P15 Fedora 32 16 199624704 216008703 7.8 GiB 8300 ZD8P16 Fedora 33 17 216008704 232392703 7.8 GiB 8300 ZD8P17 Tubuntu 1804... 18 232392704 248776703 7.8 GiB 8300 ZD8P18 openSUSE 15.2.1 # lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 238.5G 0 disk ├─sda1 8:1 0 320M 0 part ├─sda2 8:2 0 1.7G 0 part [SWAP] ├─sda3 8:3 0 400M 0 part ├─sda4 8:4 0 3.9G 0 part /usr/local ├─sda5 8:5 0 6.3G 0 part /home ├─sda6 8:6 0 12.3G 0 part /pub ├─sda7 8:7 0 7.8G 0 part /disks/stw ├─sda8 8:8 0 7.8G 0 part /disks/s150 ├─sda9 8:9 0 7.8G 0 part /disks/s151 ├─sda10 8:10 0 7.8G 0 part ├─sda11 8:11 0 7.8G 0 part / ├─sda12 8:12 0 7.8G 0 part ├─sda13 8:13 0 7.8G 0 part ├─sda14 8:14 0 7.8G 0 part ├─sda15 8:15 0 7.8G 0 part ├─sda16 259:0 0 7.8G 0 part ├─sda17 259:1 0 7.8G 0 part └─sda18 259:2 0 7.8G 0 part # cfdisk Disk: /dev/sda Size: 238.5 GiB, 256060514304 bytes, 500118192 sectors Label: gpt, identifier: 5B330B05-5C88-4DF5-8359-67FF3E52CDC4 Device Start End Sectors Size Type
/dev/sda1 2048 657407 655360 320M EFI System /dev/sda2 657408 4245503 3588096 1.7G Linux swap /dev/sda3 4245504 5064703 819200 400M Linux filesystem /dev/sda4 5064704 13256703 8192000 3.9G Linux filesystem /dev/sda5 13256704 26363903 13107200 6.3G Linux filesystem /dev/sda6 26363904 52168703 25804800 12.3G Linux filesystem /dev/sda7 52168704 68552703 16384000 7.8G Linux filesystem /dev/sda8 68552704 84936703 16384000 7.8G Linux filesystem /dev/sda9 84936704 101320703 16384000 7.8G Linux filesystem /dev/sda10 101320704 117704703 16384000 7.8G Linux filesystem /dev/sda11 117704704 134088703 16384000 7.8G Linux filesystem /dev/sda12 134088704 150472703 16384000 7.8G Linux filesystem /dev/sda13 150472704 166856703 16384000 7.8G Linux filesystem /dev/sda14 166856704 183240703 16384000 7.8G Linux filesystem /dev/sda15 183240704 199624703 16384000 7.8G Linux filesystem /dev/sda16 199624704 216008703 16384000 7.8G Linux filesystem /dev/sda17 216008704 232392703 16384000 7.8G Linux filesystem /dev/sda18 232392704 248776703 16384000 7.8G Linux filesystem Free space 248776704 500118158 251341455 119.9G ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────┐ │ Partition name: ZD8P01 EFI System (ESP) │ │ Partition UUID: 5B331D7F-9488-4DF5-9EED-C7250696B833 │ │ Partition type: EFI System (C12A7328-F81F-11D2-BA4B-00A0C93EC93B) │ │ Filesystem UUID: 20A0-2A08 │ │Filesystem LABEL: ZD8P01ESP │ │ Filesystem: vfat │ └──────────────────────────────────────────────────────────────────────────────────────────────────────────┘
[ Delete ] [ Resize ] [ Quit ] [ Type ] [ Help ] [ Write ] [ Dump ] Quit program without writing changes</pre> </body> </html> -- Evolution as taught in public schools, like religion, is based on faith, not on science. Team OS/2 ** Reg. Linux User #211409 ** a11y rocks! Felix Miata *** http://fm.no-ip.com/ -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 03/11/2020 15:31, Istvan Gabor wrote:
But between logical partitions cfdisk inserts 2048 empty sectors. Eg sdb4 starts at sector 176162816 but sdb5 starts at 176164864. There are 2048 unused sectors between the two. Similarly, sdb5 ends at 218107903 but sdb6 starts at 218109952. Again there are 2048 unused sectors between the two.
DAMNITALLTOHELL! I keep telling myself that the next time I will format the whole disk as LVM now that it is possible to set up Linux to boot into a LVM 'partition' (logical volume). I'm already using a LV as a second swap area. I suppose on the one partition to rule them all' principles you can also apply BtrFS to handle boot, root and the rest on the 'one file system to rule them all' principle. Anyway, if this isn't going to be your primary disk then you can do the "suck it and see" approach to learning about LVM or BtrFS using this SSD. I'm presently locked in to a small boot partition Device Start End Sectors Size Type /dev/sda1 34 3906250 3906217 1.9G EFI System /dev/sda2 3907584 15624191 11716608 5.6G Microsoft basic data /dev/sda3 15624192 1953523711 1937899520 924.1G Linux LVM main:/dev/disk/by-label # ls -l BOOT ROOT4 SWAP HOME TMP lrwxrwxrwx 1 root root 10 Nov 3 21:32 BOOT -> ../../sda1 lrwxrwxrwx 1 root root 11 Nov 1 17:39 HOME -> ../../dm-11 lrwxrwxrwx 1 root root 10 Nov 1 17:39 ROOT4 -> ../../dm-0 lrwxrwxrwx 1 root root 10 Nov 3 21:32 SWAP -> ../../sda2 lrwxrwxrwx 1 root root 10 Nov 1 17:39 TMP -> ../../dm-8 Oh, yes, i know the arguments against using LVM for root/boot viz debug crashed system. Yes, "it used to be but we changed all that". It depends on your boot loader. heck, I recall repairing AIX long ago when LVM was termed 'the veritas file management system'. See also: https://cromwell-intl.com/open-source/lvm-rescue-boot.html Anyway, that's really a historical artefact from when you couldn't boot into LVM with Linux. -- “Reality is so complex, we must move away from dogma, whether it’s conspiracy theories or free-market,” -- James Glattfelder. http://jth.ch/jbg -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
03.11.2020 23:31, Istvan Gabor пишет:
Hello:
I have a 250 GB SSD I want to partition with cfdisk. It is from util-linux 2.33.1, default on openSUSE Leap 15.1 I have.
I've set a DOS compatible msdos partition scheme.
No, you have not. fdisk has "DOS compatibility" flag (fdisk -c=dos) which changes default partition alignment. You partitions are aligned on 1MiB which means they were created in "nondos" compatibility mode. Defaults changed over time. Or you need to explain what exactly you mean with "set a DOS compatible msdos partition scheme". It is always better to show actual command you used instead of describing what you intended (or believed this command would do).
The created partitions in cfdisk are:
Device Boot Start End Sectors Size Id Type /dev/sdb1 2048 8390655 8388608 4G 83 Linux /dev/sdb2 8390656 92276735 83886080 40G 83 Linux /dev/sdb3 92276736 176162815 83886080 40G 83 Linux /dev/sdb4 176162816 488397167 312234352 148.9G 5 Extended ├─/dev/sdb5 176164864 218107903 41943040 20G 83 Linux
├─/dev/sdb6 218109952 260052991 41943040 20G 83 Linux ├─/dev/sdb7 260055040 301998079 41943040 20G 83 Linux └─Free space 302000128 488397167 186397040 88.9G
The primary partitions are aligned right after each other. Eg sdb1 ends at sector 8390655 and sdb starts at 8390656.
But between logical partitions cfdisk inserts 2048 empty sectors. Eg sdb4 starts at sector 176162816 but sdb5 starts at 176164864. There are 2048 unused sectors between the two. Similarly, sdb5 ends at 218107903 but sdb6 starts at 218109952. Again there are 2048 unused sectors between the two.
1. Why does cfdisk insert these unused spaces between partitions?
2. If I used parted and aligned the extended partitions right after each other (like the primary partitions) would it cause any problem?
Thanks in advance,
Istvan
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Wed, 4 Nov 2020 08:45:04 +0300 időpontban Andrei Borzenkov írta:
03.11.2020 23:31, Istvan Gabor пишет:
Hello:
I have a 250 GB SSD I want to partition with cfdisk. It is from util-linux 2.33.1, default on openSUSE Leap 15.1 I have.
I've set a DOS compatible msdos partition scheme.
No, you have not. fdisk has "DOS compatibility" flag (fdisk -c=dos) which changes default partition alignment. You partitions are aligned on 1MiB which means they were created in "nondos" compatibility mode. Defaults changed over time.
OK, I meant msdos partition table (disklabel). At least parted names it like that. # parted /dev/sda GNU Parted 3.2 Using /dev/sda Welcome to GNU Parted! Type 'help' to view a list of commands. (parted) print ... Partition Table: msdos cfdisk calls it label: Disk: /dev/sda Label: dos When I wrote DOS compatible msdos partition scheme I meant that the partition table can have maximum 4 primary partitions, and more partitions can be added when 1 of the 4 partitions is set to extended partition which holds logical partitions. Istvan -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
participants (10)
-
Andrei Borzenkov
-
Anton Aylward
-
Carlos E. R.
-
Carlos E.R.
-
David Haller
-
Felix Miata
-
Istvan Gabor
-
James Knott
-
jdd@dodin.org
-
Markus Koßmann