ISPConfig 3 - replace /var/vmail Hard Disk Drive

Discussion in 'Server Operation' started by Gonzalo Azofeifa, May 9, 2017.

  1. Gonzalo Azofeifa

    Gonzalo Azofeifa New Member

    Hello,
    I'm running out of space on the hard disk drive in which resides /var/vmail. The system is using lvm but there is no physical space on the server to place a new drive an expand the lvm volume. My question is, if a take a new HDD with more available space and back-up the info with rsync can I replace the drive with the new HDD without ISPConfig have some issues with the new one?

    Thanks in advance for your help.
     
  2. Tekati

    Tekati Member Moderator

    In short Yes.
    You can simply move everything as long as you move EVERYTHING and the permission under /var/vmail

    You would need to make a script to set all the file permission bits unless you rsync -p those over correctly. But we move mail like this all the time without issue. We have even fubared the permissions and a script easily fixed that.

    If your server has USB3.0 (easiest) or USB2.0 if you don''t have too much mail or not in a time crunch.
    Simply get a USB to ??? hard drive interface and move the files over via USB then replace and mount the new drive partition.
     
    Gonzalo Azofeifa likes this.
  3. sjau

    sjau Local Meanie Moderator

    well, I'd first add new harddrive, then you use rsync -ap to sync the files. Once initial sync is down, do another sync with the same parameters.

    Then power down dovecot/courier/postfix [whatever mta/pop3/imap servers you use].

    Redo the same sync (as new mails could have arrived meanwhile or new mails written), that should now be rather short.

    Now you have all suff synced to new disk. Then you could renmae the /var/vmail to maybe /var/vmail_old and mount the new drive at /var/vmail. AFterwards stard mta/pop3/imap servers again.
     
    Gonzalo Azofeifa likes this.
  4. Tekati

    Tekati Member Moderator

    In his original post he mentions there is no physical room in the server.

     
  5. Gonzalo Azofeifa

    Gonzalo Azofeifa New Member

    Guys thanks for your response, I used the command rsync -ah --progress but I dont know if it's necessary the -p flag to keep all the permission?

    Also I would really appreciate if you can provide an example of the script to re-assing all permission.
     
    Last edited: Jun 11, 2017
  6. Gonzalo Azofeifa

    Gonzalo Azofeifa New Member

    Tekati,
    I mounted a HDD in a encapsulator via USB to replace it once the copy its completed. I have the same situation with 2 ispconfig3 servers. One is the case in the original post, the other server the drive that is running out of space resides on a NFS server, I wonder if the UUID of the hard drive would affect the mail server to access the drive? (it. I already checked all the NFS parameters on nfs server and mail server and it seems that this configuration would not be necessary to be modify.

    Maybe some of you had already some scenario like this.

    Thanks a lot for all your help.
     
    Last edited: Jun 12, 2017
  7. sjau

    sjau Local Meanie Moderator

    Well, "-a" includes "-p" as well, so no necessary:
    it's just a habit of mine to use -avp :)
    So, with -a permissions will also be transferred, no need to fix them afterwards
     
    Gonzalo Azofeifa likes this.
  8. Gonzalo Azofeifa

    Gonzalo Azofeifa New Member

    sjau thank you, I run the rsync command with the -p flag just in case! :D
     

Share This Page