[Gptfdisk-general] unexpected results from `sgdisk --largest-new`
Brought to you by:
srs5694
From: andrew b. <abe...@ar...> - 2019-07-23 23:54:01
|
hello - i'm seeing some unexpected (to me) results when running `sgdisk -- largest-new` and wondering if it's a bug or a misunderstanding on my part. testing with GPT fdisk (sgdisk) version 1.0.4. the documentation states: -N, --largest-new=num Create a new partition that fills the largest available block of space on the disk. You can use the -a (--set-alignment) option to adjust the alignment, if desired. A num value of 0 causes the program to use the first available partition number. i've attached output with details, but the behavior can be summarized as: 1. create a 500g logical volume 2. run `sgdisk --largest-new=0`; this creates a 500.0 GiB partition starting at 2048 (as expected) 3. extend the lv to 600g 4. run `sgdisk --largest-new=0` again; this ignores the add'l 100g and instead creates a 1007.0 KiB partition starting at sector 34 5. an additional `sgdisk --largest-new=0` creates the expected 100.0 GiB partition in the added space on a whim, i also tried `partprobe` between `lvextend` and the 2nd `sgdisk` invocation. same results. also tested `--largest-new=2` with no change. from my understanding of the option documentation, the `--largest-new` invocation after growing the lv should have consumed that space instead of making the tiny partition at the beginning of the device. does that match others' views/experience? as a guess, it might have something to do with the "last usable sector" calculation, which appears unchanged at 1048575966 the first time it prints the info for what it does see as a 600.0 GiB lv... thanks in advance for any feedback. if i don't hear anything i'll probably file a bug on ubuntu's launchpad. andy -- andrew bezella <abe...@ar...> internet archive |