1

I mounted /usr from the nvidia TX1 dev board to an external SSD connected to the board.

I am wondering how I can restore it original state without re-flashing? If I power down,and disconnect the SSD, and start, there will be no /usr directory.

I was thinking of making a copy to /root/usr and updating fstab to point to that instead of the external SSD, but there has to be a better option, I just cant think of it at the moment.

If it were a regular x86 I'd just boot to a live CD and fix it, but this is an SoC with Arm, so it's not quite that easy

closed as unclear what you're asking by Rui F Ribeiro, jimmij, Mr Shunz, Archemar, msp9011 Feb 4 at 14:58

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

1

Use a bind mount of / to make the original /usr (which should probably be empty there if /usr was mounted over it before /usr was ever populated) available and copy the mounted /usr over it.

# mkdir /root/underlyingroot
# mount --bind --make-private / /root/underlyingroot
# cp -ax /usr /root/underlyingroot
# umount /root/underlyingroot

--make-private is to cancel the case where / is mounted with the shared option, which it is when running systemd. Else anything mounted (eg: automount of an inserted device etc.) between the mount and umount above will be reflected inside /root/underlyingroot and prevent the simple umount /root/underlyingroot working after.

Now that the copy is done at the final place you can edit /etc/fstab and remove the /usr mountpoint.

If nothing at all running is using /usr you might be able to also umount immediately /usr and be done. But nowadays it's hard to have things running not using /usr at all if not in single user or rescue mode and today not even even always (eg newer CentOS), so a reboot is probably needed anyway. You can also consider umount --lazy /usr which would allow to immediately get rid of /usr and have any new updates to /usr done on the internal storage instead of external, but external would still be required until next reboot.

Not the answer you're looking for? Browse other questions tagged or ask your own question.