Score:1

Autoinstaller: keep the /home if available, (and automatically add users)

cx flag

What I would like to do is to make an autoinstaller that only installs the OS but would try to keep, and attach, an existing home directory - and automatically make the user(s) again.

But looking through Curtin storage documentation, it seems that there is no way to try to only set up certain storage if it isn't there, right? I.e. either you

  • wipe everything, format the disk, make partitions, make LVM etc etc and overwrite everything;
  • or you keep everything;

But you can't tell Curtin to look if there is anything to keep (then keep it, otherwise make it)?

I tried to

    - ptable: gpt
      path: /dev/nvme0n1
      preserve: true
      id: disk-nvm
[...]
    - device: disk-nvm
      size: 536870912
      wipe: superblock
      flag: boot
      number: 1
      preserve: false
    - device: disk-nvm
      type: partition
      id: partition-2
      size: -1
      number: 2
      preserve: true
      grub_device: false

... but that would bail out telling me that partition 1 could not be made (yeah, because it was there already). Another setup where I tried to preserve a "home" lvm, wouldn't work out because home just wasn't there, the volume was created but it wasn't formatted (yeah, "If the preserve key is set to true, curtin will not format the partition" - apparently even not if it isn't formatted at all).

Oh, BTW, if anyone got a bright idea how to build an autoinstaller that would detect an existing /home somewhere and automatically add its users, please answer below.

(Auto-adding the users would be a simple trick, add user without password, password expired - I can do that, it's the preservation part that puzzles me).

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.