GNU bug report logs - #68379
[resizepart] GPT table relocation during partition resizing

Previous Next

Package: parted;

Reported by: Andrea Da Col <andrea.dacol <at> seco.com>

Date: Thu, 11 Jan 2024 08:41:01 UTC

Severity: normal

To reply to this bug, email your comments to 68379 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-parted <at> gnu.org:
bug#68379; Package parted. (Thu, 11 Jan 2024 08:41:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Andrea Da Col <andrea.dacol <at> seco.com>:
New bug report received and forwarded. Copy sent to bug-parted <at> gnu.org. (Thu, 11 Jan 2024 08:41:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Andrea Da Col <andrea.dacol <at> seco.com>
To: "bug-parted <at> gnu.org" <bug-parted <at> gnu.org>
Cc: Daniel Rinaldi <daniel.rinaldi <at> seco.com>
Subject: [resizepart] GPT table relocation during partition resizing
Date: Thu, 11 Jan 2024 07:58:17 +0000
[Message part 1 (text/plain, inline)]
Good morning,

We are dealing with the following status:

~> sudo sgdisk -p /dev/sda
Disk /dev/sda: 60538881 sectors, 28.9 GiB
Model: DataTraveler 3.0
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): DB25F93B-B36F-46DE-A10D-D5D5BA500CE8
Partition table holds up to 128 entries
Main partition table begins at sector 8192 and ends at sector 8223
First usable sector is 8224, last usable sector is 60530657
Partitions will be aligned on 8-sector boundaries
Total free space is 57902538 sectors (27.6 GiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1           16384           59979   21.3 MiB    0700  boot
   2           65536          114831   24.1 MiB    0700  bootfs_A
   3          122880          988179   422.5 MiB   8300  rootfs_A
   4          991232         1040527   24.1 MiB    0700  bootfs_B
   5         1048576         1913875   422.5 MiB   8300  rootfs_B
   6         1913880         2254665   166.4 MiB   8300  datafs
   7         2254672         2595457   166.4 MiB   8300  varfs
   8         2595464         2660999   32.0 MiB    8300  appfs

As you can see, we have GPT not at the beginning of the disk, but we have relocated it at sector 8192 (architectural needs). We need to resize appfs partition to take all free space. So:

~> sudo parted /dev/sda
GNU Parted 3.4
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) resizepart
Warning: Not all of the space available to /dev/sda appears to be used, you can fix the GPT to use all of
the space (an extra 8190 blocks) or continue with the current setting?
Fix/Ignore? Ignore
Partition number? 8
End?  [1362MB]? 100%
(parted) q
Information: You may need to update /etc/fstab.

~> sudo sgdisk -p /dev/sda
Disk /dev/sda: 60538881 sectors, 28.9 GiB
Model: DataTraveler 3.0
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): DB25F93B-B36F-46DE-A10D-D5D5BA500CE8
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 8224, last usable sector is 60530657
Partitions will be aligned on 8-sector boundaries
Total free space is 32880 sectors (16.1 MiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1           16384           59979   21.3 MiB    0700  boot
   2           65536          114831   24.1 MiB    0700  bootfs_A
   3          122880          988179   422.5 MiB   8300  rootfs_A
   4          991232         1040527   24.1 MiB    0700  bootfs_B
   5         1048576         1913875   422.5 MiB   8300  rootfs_B
   6         1913880         2254665   166.4 MiB   8300  datafs
   7         2254672         2595457   166.4 MiB   8300  varfs
   8         2595464        60530657   27.6 GiB    8300  appfs

As you can see, the partition has correctly been resized, but the partition table has been relocated at sector 2. I am expecting the resizepart command would update the current GPT information without moving it.

Thank you all in advice
Best regards,


Andrea Da Col

____

Embedded SW Engineer


[cid:3fce49c5-2469-4833-b78e-1ae832a4c109]

SECO S.p.A.
Via Achille Grandi, 20 - 52100 Arezzo, ITALY - VAT IT 00325250512
Ph.: +39 0575 26 979 - Fax +39 0575 350 210
www.seco.com<https://www.seco.com/>



 Le informazioni contenute nella presente e-mail e negli allegati sono strettamente confidenziali in conformità al D.lgs. n. 196/2003 e al Regolamento (UE) 679/2016, pertanto i soggetti non autorizzati non possono avervi accesso e/o farne uso. Per maggiori informazioni sul trattamento dei dati personali è possibile visitare la sezione Legal del nostro sito.

The information included in this e-mail and in the attachments are strictly confidential in compliance with Legislative Decree n. 196/2003 and Regulation (EU) 2016/679 and should not be accessed and/or used by unauthorized person. For further information on the processing of personal data see the Legal section of our website.

[Message part 2 (text/html, inline)]
[Outlook-fvtobrcj.png (image/png, inline)]

Information forwarded to bug-parted <at> gnu.org:
bug#68379; Package parted. (Thu, 11 Jan 2024 19:45:02 GMT) Full text and rfc822 format available.

Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):

From: bill-auger <bill-auger <at> peers.community>
To: Andrea Da Col via Bug reports for the GNU Parted disk partition editor
 <bug-parted <at> gnu.org>
Cc: Andrea Da Col <andrea.dacol <at> seco.com>,
 Daniel Rinaldi <daniel.rinaldi <at> seco.com>, 68379 <at> debbugs.gnu.org
Subject: Re: bug#68379: [resizepart] GPT table relocation during partition
 resizing
Date: Thu, 11 Jan 2024 14:43:56 -0500
also FWIW:
> Main partition table begins at sector 2 and ends at sector 33
> First usable sector is 8224

one may also have expected that if the partition table were moved backward,
that the now unusable space from 34-8223 would have been reaped and now usable




Information forwarded to bug-parted <at> gnu.org:
bug#68379; Package parted. (Thu, 11 Jan 2024 19:45:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-parted <at> gnu.org:
bug#68379; Package parted. (Fri, 12 Jan 2024 01:13:01 GMT) Full text and rfc822 format available.

Message #14 received at 68379 <at> debbugs.gnu.org (full text, mbox):

From: "Brian C. Lane" <bcl <at> redhat.com>
To: Andrea Da Col <andrea.dacol <at> seco.com>
Cc: Daniel Rinaldi <daniel.rinaldi <at> seco.com>, 68379 <at> debbugs.gnu.org
Subject: Re: bug#68379: [resizepart] GPT table relocation during partition
 resizing
Date: Thu, 11 Jan 2024 17:12:40 -0800
Hi,

Thanks for the excellent description. This is the first time I've seen
someone using a non-standard location for the header. parted makes some
assumptions, as you can see, and has hard-coded those into its pmbr
write code.

I'll have to think about this, but at the moment there is no way to work
around this other than not using parted on these disk.

Thanks,

Brian

-- 
Brian C. Lane (PST8PDT) - weldr.io - lorax - parted - pykickstart





This bug report was last modified 1 year and 158 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.