Skip to main content
7 of 8
Added Update Section
eyoung100
  • 7.5k
  • 25
  • 54

Clarification Needed: Using Rsync to Move /usr

Context

I recently migrated Windows 10 and Gentoo to 2 separate 250 GB SSD's and left my old traditional SATA HDD Drives in to use for Storage.

  1. I put Users on a HDD for Windows during a new install.
  2. I used a GParted LiveCD to shrink my root file system, and copied it to the new drive, rebooted, and then deleted the old root I'm leaving /home and a swap partition on my HDD Drive. This all works great, as I'm booting using the UUID's.

Since I'm on Gentoo, I need to move just the /usr directory from the SSD back to the original HDD I copied it from, so that the Portage Tree doesn't hog the small SSD space during updates. I'm not tagging this with gentoo until now(See Update Heading), because this question is related to the proper command options needed for rsync For a bit of context, the portage tree is Gentoo's package repository. The entire repository is downloaded to the user's local machine before updating. Downloading it to the SSD would cause needless wear, as the tree is updated daily.

Issue

I found the following two questions related to what I'm trying to accomplish:

  1. ServerFault: Mount /usr on different partition
  2. AskUbuntu: How to move /usr to a new partition?

Now I need an answer to a few of my own questions:

  1. Can I use the rsync command to move /usr while in the Gentoo install where /usr needs to be moved? The ServerFault question hints at this.
  2. If #1 isn't possible, and I use the GParted Live USB to issue the rsync command, do the file/directory owners change since the LiveUSB is based on a Debian distribution?
  3. What are the proper options for rsync besides -a for archive? The comments in the selected answer at AskUbuntu hint at adding -H to ensure hardlinks are followed, but then the OP contradicts the comments in his own answer.

Visual Aids

I need to move the /usr directory from the partition squared in red to the empty partition squared in blue, while the entire partition squared in red is running, or use a LiveCD to do so, without harming or changing the current permissions.

/usr is in this partition Empty Partition

Update

This question turned out to be a mountain that can be conquered, but I don't know if I conquer it:

  1. I am/was able to move /usr to a new partition using rsync -avAHPX /mnt/gentoo/usr /mnt/new_usr. I can't give credit for a partial answer as I'm still stuck.
  2. It does no good, as systemd complains that the root filesystem doesn't contain a valid init because the init system is in the partition that can't be mounted. Do you see the issue here?
  3. I need early userspace mounting in order to fix the issue, but in order to do that, I'd lose my Plymouth boot screen initramfs with the initramfs it takes to mount /usr early. See also Custom Initramfs and Initramfs/Guide.
  4. Support and or other Gentoo users not complaining that "Systemd Sucks" are hard to come by (which is one of the reasons, I started contributing here). As such, if I post a question in our official resources, I get booed.

If anyone can tell me the proper tools to use that combine both a plymouth bootsplash and early /usr mounting in the initramfs/intramfd, I'd appreciate it, and I'm thinking about offering a bounty, if this question sits. Also know that since Gentoo is source based that even though I linked the Gentoo Wiki articles, that I can use the tools from other distributions.

eyoung100
  • 7.5k
  • 25
  • 54