Swap partitions between /home and /var

Discussion in 'Installation/Configuration' started by clopezi, Dec 19, 2016.

  1. clopezi

    clopezi New Member

    I have a server with 2TB (Raid, 2x2TB), and this partition schema

    / => /dev/md2 - 20GB
    /home => /dev/md3 - 1.8TB

    This is a ISPConfig server, so we need many space in /var and almost nothing into /home, so i think that the best way to do this is put /home in /dev/md2 and /var into /dev/md3

    My fstab is this:

    # <file system> <mount point> <type> <options> <dump> <pass>
    /dev/md2 / ext4 errors=remount-ro 0 1
    /dev/md3 /home ext4 defaults 1 2
    /dev/sda4 swap swap defaults 0 0
    /dev/sdb4 swap swap defaults 0 0

    Which is the best way to do this? I think move /home contents to /homeold, remove from fstab, umount and now copy from /homeold to /home, and then change /var name (i dont have enough space to do the copy), mount new /var and move content, is this correct?

    Also, i need to stop all server services to avoid errors (mysql, apache, mongodb, named, etc), any fast way to do this? Or maybe i should restart in rescue mode to do this?

    Maybe another way is a full change between / and /home, i mean, put / in /md3 and /home in md2, is this possible only by edit fstab and reboot?

    Thank you sou much,
     
  2. sjau

    sjau Local Meanie Moderator

  3. clopezi

    clopezi New Member

  4. sjau

    sjau Local Meanie Moderator

    so you managed to do it?
     
  5. clopezi

    clopezi New Member

    Yes! All fine! Well, i used rsync instead cp but all fine :)
     
  6. sjau

    sjau Local Meanie Moderator

    well, some people use rsync as a cp replacement :) it's not a bad idea actually :)
     

Share This Page