MX19 install, preserving MX18 /home (one big encrypted drive)

When you run into problems installing MX Linux XFCE
Message
Author
User avatar
Michael-IDA
Posts: 359
Joined: Sat Jan 12, 2019 8:00 pm

MX19 install, preserving MX18 /home (one big encrypted drive)

#1 Post by Michael-IDA »

Hi @dolphin_oracle, and all,

I’ve watched both of:

Basic Install of mx19.2 (with Partitioning)
https://www.youtube.com/watch?v=jSYycsZPm_Q

Encrypted install of MX Linux (with partitioning)
https://www.youtube.com/watch?v=tQjftZsoySg

And saw the option to preserve /home . I have an existing encrypted MX18 ‘one big drive’ setup (info below) that I’m updating to MX19.

So, question…

Is there any way to install MX19 on top of the existing encrypted drive partition(s) and preserve /home? Or any other easy methodology to accomplish the same thing? (I do know of an ugly, time consuming method) Or any reason MX19 will bork if installing over an exiting user’s MX18 home?

Thanks,
Michael

Other Ref:
Encryption on MX Linux 19.1.x64
viewtopic.php?f=94&t=58070

Code: Select all

Disk /dev/nvme0n1:

Device              Start        End    Sectors   Size Type
/dev/nvme0n1p1         34     524287     524254   256M EFI System
/dev/nvme0n1p2     524288    1572863    1048576   512M Linux filesystem
/dev/nvme0n1p3    1572864 1949263871 1947691008 928.7G Linux filesystem
/dev/nvme0n1p4 1949263872 1953458175    4194304     2G Linux filesystem
NIH Cancer Study: The group supplemented with both vitamins and fenbendazole exhibited significant (P = 0.009) inhibition of tumor growth.
The day Microsoft makes a product that doesn't suck...
... is the day they make a vacuum cleaner.

User avatar
JayM
Posts: 6796
Joined: Tue Jan 08, 2019 3:47 am

Re: MX19 install, preserving MX18 /home (one big encrypted drive)

#2 Post by JayM »

In my experience, once you do an encrypted installation all bets are off regarding preserving home on a reinstall. You need to back up to another drive or partition then restore afterward.
Please read the Forum Rules, How To Ask For Help, How to Break Your System and Don't Break Debian. Always include your full Quick System Info (QSI) with each and every new help request.

User avatar
Michael-IDA
Posts: 359
Joined: Sat Jan 12, 2019 8:00 pm

Re: MX19 install, preserving MX18 /home (one big encrypted drive)

#3 Post by Michael-IDA »

*cry*

Yeah, how I've always done it. Just really, really hoping in the installer I could re-use the existing LUKS or there was a way in the process to partition, format, unpack a tarball on /home, then start the system install with the preserve /home switch.

Got one shot, if I get lucky I'll post what I did...

Thanks Jay,
Michael
NIH Cancer Study: The group supplemented with both vitamins and fenbendazole exhibited significant (P = 0.009) inhibition of tumor growth.
The day Microsoft makes a product that doesn't suck...
... is the day they make a vacuum cleaner.

User avatar
JayM
Posts: 6796
Joined: Tue Jan 08, 2019 3:47 am

Re: MX19 install, preserving MX18 /home (one big encrypted drive)

#4 Post by JayM »

The only thing I can think of that might work is if you did an unencrypted installation over an encrypted one, and if the installer prompts you for the decryption password so it can unlock the LUKS volume and access the partitions. But I haven't had the guts to try it.
Please read the Forum Rules, How To Ask For Help, How to Break Your System and Don't Break Debian. Always include your full Quick System Info (QSI) with each and every new help request.

User avatar
dolphin_oracle
Developer
Posts: 22247
Joined: Sun Dec 16, 2007 12:17 pm

Re: MX19 install, preserving MX18 /home (one big encrypted drive)

#5 Post by dolphin_oracle »

I don't think we support preserving a home inside an encypted root partition. The best would be to copy home out to another device, do the install, and sync up again all from the live media.
http://www.youtube.com/runwiththedolphin
lenovo ThinkPad X1 Extreme Gen 4 - MX-23
FYI: mx "test" repo is not the same thing as debian testing repo.

User avatar
JayM
Posts: 6796
Joined: Tue Jan 08, 2019 3:47 am

Re: MX19 install, preserving MX18 /home (one big encrypted drive)

#6 Post by JayM »

I know for a fact that you can't do an encrypted reinstallation reusing existing encrypted partitions and preserving home as the installation will re-encrypt them which wipes out all existing data. The installer even tells you that you can't preserve home if you use encryption. BTDT. You have to back up /home's contents, reinstall, then restore your data the old-fashioned way. OTOH of /home is on a separate partition rather than being in the root partition you may be able to reuse it and its existing encryption (don't check the box to encrypt it again.) I think though that after installation while still running from the live USB you'll have to manually add a keyfile to the /home LUKS volume then manually edit /etc/crypttab and /etc/fstab so it can automount, although you could also log into the installed system as root and run the Settings/Disk Manager tool to auto-generate the fstab entry (but not crypttab: you have to do that one yourself.)
Please read the Forum Rules, How To Ask For Help, How to Break Your System and Don't Break Debian. Always include your full Quick System Info (QSI) with each and every new help request.

User avatar
Michael-IDA
Posts: 359
Joined: Sat Jan 12, 2019 8:00 pm

Re: MX19 install, preserving MX18 /home (one big encrypted drive)

#7 Post by Michael-IDA »

JayM wrote: Sun Jul 19, 2020 9:22 pm The only thing I can think of that might work is if you did an unencrypted installation over an encrypted one, and if the installer prompts you for the decryption password so it can unlock the LUKS volume and access the partitions. But I haven't had the guts to try it.
This might work, but!, you’d have to be really careful to save all the existing crypttab, fstab, LUKS bits somewhere on the Live USB so you could re-create them just before you rebooted after the install was finished. Like you, not sure if I have the guts to try that, I see either sitting 5+ hours waiting for a dd to re-image the drive or doing the whole install from scratch again...
JayM wrote: Mon Jul 20, 2020 12:02 am … if /home is on a separate partition rather than being in the root partition you may be able to reuse it and its existing encryption (don't check the box to encrypt it again.) I think though that after installation while still running from the live USB you'll have to manually add a keyfile to the /home LUKS volume then manually edit /etc/crypttab and /etc/fstab so it can automount, although you could also log into the installed system as root and run the Settings/Disk Manager tool to auto-generate the fstab entry (but not crypttab: you have to do that one yourself.)
Out of all the possible options this is probably the easiest long term (if you’re comfortable with manually mucking with LUKS). Especially as we’re not space limited like we were in the past, so breaking / and /home into separate partitions shouldn't cause any problems... I’m going to try basically this as a test (next weekend):

- Clean install of MX19 with both / and /home encrypted partitions.
- Dump my old /home on to new /home.
- Copy out the LUKS bits.
- Clean install of MX19 with / encrypted and reuse /home ((don't check the box to encrypt it).
- Add back in the LUKS bits.
- Reboot (and don’t hold my breath).

But now I need a size for /.

The MX-19.1 Users Manual says:
How big should / (root) be?
Recommended size for normal use is therefore 10 GB.
https://mxmanuals.s3.us-east-2.amazonaw ... 9/mxum.pdf

Is that for real and not just 'never got updated?’ I’m showing ~21GB for non /home now (and I am not a packrat either) and @dolphin_oracle you’re using ~35GB and ~70GB roots in your vids (granted you’re a dev and have multiple kernels, etc.).

For a routine user, whats a good root size? Basically a, “I know this is too big, but it’s not horrible, and I’ll never need to worry about it” type size.

Thanks for all the replies,
Michael
NIH Cancer Study: The group supplemented with both vitamins and fenbendazole exhibited significant (P = 0.009) inhibition of tumor growth.
The day Microsoft makes a product that doesn't suck...
... is the day they make a vacuum cleaner.

User avatar
Michael-IDA
Posts: 359
Joined: Sat Jan 12, 2019 8:00 pm

Re: MX19 install, preserving MX18 /home (one big encrypted drive)

#8 Post by Michael-IDA »

JayM wrote: Sun Jul 19, 2020 9:22 pm The only thing I can think of that might work is if you did an unencrypted installation over an encrypted one, and if the installer prompts you for the decryption password so it can unlock the LUKS volume and access the partitions. But I haven't had the guts to try it.
Will do a real write up this week sometime... Edit 2025 next weekend. never...

So, this was the key to figuring out how to get it to work. Short answer:

- Tarball existing /home/user dir, copy it to something external (old-home).
- Run the installer, manually partition and encrypt everything with a passphrase you’ll use in production (throw-away).
- Remember the passphrase!
- Boot throw-away, unpack tarball on /home/{whatever}
- logout of user, SHIFT-ALT-F1, login as root
- As root move old-home to /home/user, fix perms, etc.
- Shutdown

- Boot Live USB
- Run the installer, don’t partition, select manual partitioning
- Select existing partitions and check encrypt for everything
- Use the exact same passphrase!
- Check preserve /home

Answer the other questions, and it just works. The installer will not ask for any other passphrase, so you have to use the same one both times.

Saved me 50 - 100 hours of re-doing settings, configs, passwords, key-bindings, panel settings, button modifications, etc., etc. as they popped up over the next year...

Best,
Michael
Last edited by Michael-IDA on Sun Mar 30, 2025 6:23 pm, edited 1 time in total.
NIH Cancer Study: The group supplemented with both vitamins and fenbendazole exhibited significant (P = 0.009) inhibition of tumor growth.
The day Microsoft makes a product that doesn't suck...
... is the day they make a vacuum cleaner.

User avatar
Michael-IDA
Posts: 359
Joined: Sat Jan 12, 2019 8:00 pm

Re: MX19 install, preserving MX18 /home (one big encrypted drive)

#9 Post by Michael-IDA »

dolphin_oracle wrote: Sun Jul 19, 2020 10:55 pm I don't think we support preserving a home inside an encypted root partition. The best would be to copy home out to another device, do the install, and sync up again all from the live media.
You do see prior post ;)

I promised you $200 if you (MX) could get this working, if I didn't do it now I'd have forgotten it, so, done.

Best Regards Dolphin,
Michael
NIH Cancer Study: The group supplemented with both vitamins and fenbendazole exhibited significant (P = 0.009) inhibition of tumor growth.
The day Microsoft makes a product that doesn't suck...
... is the day they make a vacuum cleaner.

User avatar
dolphin_oracle
Developer
Posts: 22247
Joined: Sun Dec 16, 2007 12:17 pm

Re: MX19 install, preserving MX18 /home (one big encrypted drive)

#10 Post by dolphin_oracle »

Oh my, that's going in the wiki LOL thanks!

you get a gold star :)
http://www.youtube.com/runwiththedolphin
lenovo ThinkPad X1 Extreme Gen 4 - MX-23
FYI: mx "test" repo is not the same thing as debian testing repo.

Post Reply

Return to “Installation”