Skip to content

Instantly share code, notes, and snippets.

@famellad
Last active July 21, 2021 06:03
Show Gist options
  • Select an option

  • Save famellad/7f3cf240a0f526d40e9adee78d208bca to your computer and use it in GitHub Desktop.

Select an option

Save famellad/7f3cf240a0f526d40e9adee78d208bca to your computer and use it in GitHub Desktop.
Just a small tutorial on how to install the /home directory on a Dynamic Disk/LDM RAID using systemd

Intro

Everywhere I looked claimed this is impossible. Not only it is possible, it also works perfectly and it's not even that much of a hassle!

Steps

  1. Create the LDM setup on Windows
  2. Partition the array and format ext4 on Windows
  3. Install Linux including /home on non-LDM contiguous partitions
  4. Install libldm
  5. Configure fstab
  6. Configure systemd
  7. Copy user directories
  8. Reboot
  9. Delete old /home
  10. Using a live environment merge the root partition and the old /home partition

Install Linux

Partition Setup

Different partitions on contiguous space

Install libldm

Install libldm using the package manager of your distro, refer to this Arch Wiki page for further information setting libldm up.

Configuration

fstab

You must specify the partition by UUID in fstab, the line should look like this, of course according to your own needs:

UUID=1b809ffc-8629-4c46-9ac5-74429d89a960 /home 	 ext4    defaults,noatime 0 2

As you can see, once LDMTool is running the system will transparently view the partition as normal. Don't forget to disable the old /home partition before rebooting.

TODO: How in tarnation do I obtain said UUID?

systemd

Edit the home.mount unit on systemd:

systemctl edit home.mount

Need to add After=ldmtool.service to the list of dependencies:

### Editing /etc/systemd/system/home.mount.d/override.conf
### Anything between here and the comment below will become the new contents of the file

[Unit]
Documentation=man:fstab(5) man:systemd-fstab-generator(8)
SourcePath=/etc/fstab
Requires=systemd-fsck@dev-disk-by\x2duuid-1b809ffc\x2d8629\x2d4c46\x2d9ac5\x2d74429d89a960.service
After=systemd-fsck@dev-disk-by\x2duuid-1b809ffc\x2d8629\x2d4c46\x2d9ac5\x2d74429d89a960.service
After=blockdev@dev-disk-by\x2duuid-1b809ffc\x2d8629\x2d4c46\x2d9ac5\x2d74429d89a960.target
After=ldmtool.service

[Mount]
Where=/home
What=/dev/dm-1
Type=ext4
Options=defaults,noatime

It has to be identified by its DEVICE PATH, using UUID will NOT work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment