Move huge directory on the root partition to a huge non-root parition


Assumption: /mnt is a huge disk partition separate from the / partition  (aka root partition)
  1. mkdir -p /mnt/home/myfatdirectory
  2. kill all processes that have open files to /home/myfatdirectory
    1. lsof /home/myfatdirectory
    2. make sure you get ZERO results, ie no processes have open files to this directory
  3. mv /home/myfatdirectory /home/myfatdirectory_old 
  4. mkdir -p /home/myfatdirectory
  5. mount --bind /mnt/home/myfatdirectory /home/myfatdirectory
  6. add to bottom of /etc/fstab, so the mount is picked up on reboot
    1. /mnt/home/myfatdirectory /home/myfatdirectory none bind 0 0
NOTES:
  1. fix perms as necessary by interleaving your own steps into the above
  2. for the paranoid: you might want to make sure fstab entries work fine on reboot


Comments

Popular posts from this blog

Openvpn and unbound combined break dig command

Stress Linux system: stress-ng

Google Nexus 4: permanent back panel glass repair for less than a penny