How to move /opt/alt

In rare cases customer wants to move /opt/alt to different place. There are two ways to do this:
— 1 —
Move /opt/alt somewhere (mv /opt/alt /var/opt_alt)
Make a symlink (ln -s /var/opt_alt /opt/alt)
Mount new directory with file (next do cagefsctl –remount-all)

Method 1 will work if target directory is not in /home/

important!: method 1 does not work, please use method 2

— 2 —
Move /opt/alt somewhere (mv /opt/alt /var/opt_alt)
Create /opt/alt directory (mkdir /opt/alt)
Bind mount new to old: (mount -o bind /var/opt_alt /opt/alt)
Remount cagefs (cagefsctl –remount-all)

Add an entry to /etc/fstab, something like:
/var/opt_alt /opt/alt none bind 0 0

Method 2 is universal and works in any cases no matter where target moved directory is. However will result as additional mountpoint line.

Leave a Reply

Your email address will not be published. Required fields are marked *