On Mon, 17 Apr 2000, Anthony White wrote:
> My server has outgrown itself and now needs to be put on larger
> drives.
>
> Are there any problem moving ./Maildir/ directories
> in the users home dirs to a new drive?
>
> Are there any issues moving qmail itself?
>
> I plan to move from my RedHat system from
> 2 2.1G drives to 2 9.1G drives that will
> be running in RAID 1 configuration.
I once had to move the qmail queue to another device/disk drive, and wrote
the below step-by-step. It could probably use some reviewing, and makes
some assumptions that might not be true (that you're using inetd, that you
can wait until all the messages in your queue have been delivered,
etc). In short, it's very rough, but might be of help:
--------------------------------------------------------
Wait till late at night
Make sure there are no messages in the queue
/var/qmail/bin/qmail-qread
If there are, wait until they are delivered! Very important.
Modify /etc/inetd.conf to stop incoming mail (comment out smptd)
Kill -HUP inetd
Kill -KILL qmail-send
backup the queue, probably the whole qmail directory for that matter.
Create a symbolic link from /var/qmail/queue to the new directory
cd /usr/src/qmail-1.03
Remake the queue structure (you should not do this by hand, puny mortal):
# make setup check
Startup qmail
/var/qmail/rc
Re-allow incoming connections through inetd
TEST IT OUT!
----------------------------------------------------------
I also used the below script (don't have the original author info, sorry -
anyone want to own up to it?) to readjust the queue directory after the
move. qmail names the files in the queue directory based on the file's
inode number, so this script moves the old files in ./queue.old/ (which is
on the old device) to ./queue/ (which is on the new device) with the
proper names. Again, use at your own risk, and could probably use some
refining:
------------------------------------------------------------
#!/bin/sh -x
cd /var/qmail || exit 1
find queue.old/mess -type f -printf '%f %i\n' |
awk '{print $1, $1%23, $2, $2%23}' |
while read oldi oldd newi newd; do
mv queue.old/mess/$oldd/$oldi queue/mess/$newd/$newi
mv queue.old/info/$oldd/$oldi queue/info/$newd/$newi
test -f queue.old/local/$oldd/$oldi &&
mv queue.old/local/$oldd/$oldi queue/local/$newd/$newi
test -f queue.old/remote/$oldd/$oldi &&
mv queue.old/remote/$oldd/$oldi queue/remote/$newd/$newi
test -f queue.old/bounce/$oldi &&
mv queue.old/bounce/$oldi queue/bounce/$newi
test -f queue.old/todo/$oldi &&
mv queue.old/todo/$oldi queue/todo/$newi
done
------------------------------------------------------------
I'm not sure about the Maildir directories. I believe they too have some
sort of inode number dependency built in - anyone have advice for Anthony
on moving these?
Hope this helps,
Chris
-- Chris Hardie -----------------------------
----- mailto:[EMAIL PROTECTED] ----------
-------- http://www.summersault.com/chris/ --