Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support LABEL in installed_os.json[n].partitions #874

Open
akinnee opened this issue Jan 20, 2025 · 3 comments
Open

Support LABEL in installed_os.json[n].partitions #874

akinnee opened this issue Jan 20, 2025 · 3 comments

Comments

@akinnee
Copy link

akinnee commented Jan 20, 2025

/etc/fstab supports mounting partitions using the partition label.

Looks like installed_os.json supports:

  • device node path, e.g. /dev/sda6
  • partition uuid, e.g. PARTUUID=abc-06

Mounting by LABEL would make the install better survive partition moving, since PARTUUID can change from that. It would still survive moving the drive to another port, unlike device mount path.

Currently, PINN says LABEL=OS1_BOOT is not a valid partition, even though putting the same thing in the first OS's /etc/fstab file works fine.

@procount
Copy link
Owner

PINN already supports using Label. Indeed it is necessary to boot Ubuntu.
Which OS does this refer to? Are you creating your own OS installation files?
Make sure your partition names do not have spaces in them (in partitions.json), although I do try to replace them with Underscores.

Using LABEL is not perfect, as it means you cannot have 2 instances of the same OS on the same drive.

@akinnee
Copy link
Author

akinnee commented Jan 31, 2025

PINN already supports using Label. Indeed it is necessary to boot Ubuntu.
Which OS does this refer to? Are you creating your own OS installation files?
Make sure your partition names do not have spaces in them (in partitions.json), although I do try to replace them with Underscores.

Using LABEL is not perfect, as it means you cannot have 2 instances of the same OS on the same drive.

If I try using the same label syntax in the json file that I use in fstab, then try using the fixup feature, it errors. It works fine if I specify the path (/dev/sda1 for example) in the json file and then use LABEL in fstab.

You can easily relabel the partitions to support multiple of the same os per drive. I gave each partition a unique label. No issues with my installs breaking after moving partitions around in gparted now.

@procount
Copy link
Owner

Please see partitions.json from Ubuntu as an example.
This is the syntax to use:

      "label": "system-boot",
      "requires_label": true,

The partitions.json file fields are described in https://github.com/procount/pinn/wiki/JSON-fields#partitions.json
The requires_label field is necessary to force labels to be used as references. It will also check that no existing partition has the same label name as they must be unique.

The use of partuuids, uuids, device names or labels is OS specific as not all OSes support all types. Some OSes can use whatever label names you like, but others like Ubuntu will not upgrade if the labels are not as expected. Hence you could install 2 copies of Ubuntu by changing the labels of one of them, but it will no longer be upgradable as I understand it. YMMV.

I can't explain why your use of labels is not working in your PINN installations without more information. E.g. which OS? what is your partitions.json file? what partition formats? What error message?

Make sure you conform to the maximum label lengths which are different for each format type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants