2

I want to mount /usr directory on different partition and keep the same owner on all files and subdirectories in /usr directory.

I want to mention that this issue is for linux ec2 machine where I can't enter to the single-user runlevel.

Is it possible?

2 Answers2

6

Yes, this is almost certainly possible.


  • Mount the new partition somewhere in your filesystem.
    • mount /path/to/device /mnt
  • Copy the contents of your current /usr to the new partition.
    • rsync -a /usr /mnt
  • Unmount the new partition.
    • umount /mnt
  • Update your /etc/fstab to reflect the changes.
    • /path/to/device /usr defaults 0 0
  • Mount the new partition.
    • mount /usr
user9517
  • 117,122
1

for the rsync arguments, try this: "rsync -avxHAXP", the "X" will preserve SE linux context.