Hi Peter, Thanks a lot for providing all the information!!
> Hi Michael, > > Michael Tautschnig wrote: > >Thanks a lot for debugging this issue and providing a patch. Could you > >please > >attach a config where you experienced these issues? I do acknowledge the fact > > it was a simple config like: > > disk_config sda preserve_reinstall:1,2,3 > > primary /var 100 xfs defaults > primary swap 256 swap sw > primary /scratch 100- xfs defaults > Ok, so at least my assumption that such errors only appear once you preserve a swap partition are confirmed. Probabably this is also the reason that it hasn't been reported before. > > >that there is a bug, but I believe the bug should be fixed in some other way; > >did you also test your patched version? I'm not sure whether parted will > > of course I did. > Was just curious, because ... > >actually accept linux-swap(v1) as specification. I think we should be > >rewriting > >linux-swap(v1) to swap or linux-swap in Volumes.pm. > > parted does seem to use linux-swap(v1), if I do "parted -s /dev/sda print": > > Model: ATA QEMU HARDDISK (scsi) > Disk /dev/sda: 10.7GB > Sector size (logical/physical): 512B/512B > Partition Table: msdos > > Number Start End Size Type File system Flags > 1 32.3kB 98.7MB 98.7MB primary xfs > 2 98.7MB 362MB 263MB primary linux-swap(v1) > 3 362MB 10.7GB 10.4GB primary xfs > ... I was kind of aware of the fact that linux-swap(v1) was shown by parted, but its documentation does not state that it would also be acceptable as input to mkpart and frieds. But of course I hadn't thought of the fact that my code would try to rebuild a partition as shown by parted print, and hence use the same string, including the (v1). Peter, would you be available for testing a patch, or even one of the experimental versions? I'll try to re-review your patch as soon as possible and might commit a somewhat different version. Yet, I don't see this as critical as it's just about preserving swap partitions, which does seem to be a very rare scenario. Best, Michael
pgpUtbVlgFMb8.pgp
Description: PGP signature