[ZendTo] Re: Storage location
Brad Beckenhauer
bbecken at aafp.org
Thu Sep 8 15:01:18 BST 2011
With my notes below, you do not need to change any Zendto configuration option.
Glad you got it working
Brad
>>> On 9/8/2011 at 8:50 AM, Mathieu Chartier <mchartier at cegepsth.qc.ca> wrote:
Thanks a lot for you example.
For me it’s a new installation, so I’ve just create a new partition and change the NSSDROPBOX_BASE_DIR
Regards,
Mathieu Chartier
Technicien en informatique classe principale
Services administratifs
mchartier at cegepsth.qc.ca
(450)773-6800 ou (514)875-4445 (Montréal et rive-sud), poste 2153
De : zendto-bounces at zend.to [mailto:zendto-bounces at zend.to] De la part de Brad Beckenhauer
Envoyé : 8 septembre 2011 09:48
À : Mathieu Chartier; zendto at zend.to
Objet : [ZendTo] Re: Storage location
Here is the process I used on the CentOS VM system. I have not tested it on a Ubuntun system.
No Warranty, use at your own risk and take backups!
How to move the /var/zendto directory where Zendto stores it’s attachments to a separate partition.
This document shows the process to move the /var/zendto directory to a new partition. The existing /var/zendto directory/partition will deliberately be left behind until the last step where you can decide if you want to delete the directory or re-use the partition.
This document was originally written and tested using the Zendto/Centos-64-3.61 vm on a vmware workstation. It is highly recommend that a snapshot of vm be taken before proceeding to protect your data and provide a recovery path.
WARNING: The following technique describes how to move a partition(s). Although this technique is designed so that you can "back out" of a failed partition move, it doesn't protect against user error. In other words, any time that you format partitions or copy large numbers of files, there's a possibility that you will type the wrong thing, causing lots of data to be destroyed. For this reason, it's highly recommended that you take appropriate steps to back up all critical files before proceeding.
Now that you're prepared, we're ready to start moving /var/zendto. The exact steps taken will depend on whether /var/zendto currently is located on the root partition or if it resides on its own separate partition.
If you are moving /var/zendto to a new hard drive, the new drive should be physically installed in your system or added as a new hard drive device in the vmware environment before starting. This is your change is increase the partition size.
1. Create a new partition.
If you are moving /var/zendto to an existing partition (it doesn't need to be ext3, as long as the target primary or extended partition exists), you can proceed to step 2.
If the new partition doesn't exist yet, you'll need to create it in vmware or using fdisk or cfdisk (not covered in this document). If the partition doesn't reside on your first drive, remember to specify the name of the device as the first argument to cfdisk or fdisk. After creating the appropriate primary or extended partition, you should reboot so that the partition table can be reread correctly. This is the only time you will need to reboot the system.
2. Create a file system on the new partition
To create a file system on the new partition, first make sure you know the exact device name for the new partition (for example, /dev/sda5). If you're not sure of the exact device name, stop now and double-check!
In the below and following code samples, the we will be adding a new partition (sdb) formatted as ext3 file system.
Type the following, as root to format the entire partition as type ext3:
Example of formatting /dev/sdb:
# mkfs.ext3 /dev/sdb
/dev/sdb is entire device, not just one partition!
Proceed anyway? (y,n) y
For the remainder of this document, /dev/sdb will be used. Substitute your device where appropriate.
3. Temporarily mount the new filesystem in /mnt
# mkdir /mnt/newpart
# mount /dev/sdb /mnt/newpart
4. Drop to single-user mode
I delayed this step as long as possible to maximize system availability, but we now must drop into single-user mode, and copy files from /var/zendto to /mnt/newpart. You should not have any files open in /var/zendto, and entering single-user mode eliminates this possibility:
# init 1
If prompted, enter the root password to perform system maintenance. You should now have a root shell.
5. Change directories to /var/zendto and copy files
# cd /var/zendto
# cp -ax * /mnt/newpart
The cp -ax command recursively copies the contents of /var/zendto to /mnt/newpart, preserving all file attributes, and not crossing any mount points. After this command finishes, /mnt/newpart will contain an exact copy of all the files and directories currently in /var/zendto.
5a. Unmount the new partition and remove the temporary directory.
# umount /mnt/newpart
# rm –rf /mnt/newpart
6. If the existing /var/zendto directory is part of the root (/) partition and you are moving /var/zendto to a separate partition then skip to step 6b. If /var/zendto is already a separate partition and you are moving that partition to a new partition ( such as increasing the disk size), then proceed with step 6a.
6a. Use the new partition (when the current /var/zendto is already a partition).
These instructions are for systems where the current /var/zendto already exists on its own dedicated partition. If this isn't the case, skip to item 6b.
Unmount the old partition by typing:
# cd /
# umount /var/zendto
Mount the new partition:
# mount /dev/sdb /var/zendto
Now, the new partition is available at /var/zendto and is ready to be used. Exit single-user mode, so that the system is back up and running, by pressing CTRL-D.
IMPORTANT: After the system starts up normally, log in as root and edit /etc/fstab so that /dev/sdb will be mounted automatically at /var/zendto instead of the old partition. If the line does not exist, you will need to add it the to the fstab file.
For example, change this line in the /etc/fstab file:
/dev/hda3 /var/zendto ext3 defaults 1 2
to:
/dev/sdb /var/zendto ext3 defaults 1 2
6b. Use the new partition (when the current /var/zendto is a directory on the root partition).
First rename the existing /var/zendto directory
# cd /
# mv /var/zendto /var/zendto.old
Create a new /var/zendto directory and mount the new partition to that directory.
# mkdir /var/zendto
# mount /dev/sdb /var/zendto
Now, leave single user mode by pressing CTRL-D. ( you may have to log back in as the root user).
When the system is running, edit /etc/fstab and add a line like the below line in BOLD:
# device name mount point fs-type options dump-freq pass-num
/dev/sdb /var/zendto ext3 defaults 1 2
Explanation of the above columns are as follows:
a. The device name or other means of locating the partition or data source.
b. The mount point, where the data is to be attached to the filesystem.
c. The filesystem type, or the algorithm used to interpret the filesystem.
d. Options, including if the filesystem should be mounted at boot.
e. dump-freq adjusts the archiving schedule for the partition (used by dump).
f. pass-num Controls the order in which fsck checks the device/partition for errors at boot time. The root device should be 1. Other partitions should be either 2 (to check after root) or 0 (to disable checking for that partition altogether).
A value of zero in either of the last 2 columns disables the corresponding feature.
Now the new partition will get mounted correctly the next time the system is rebooted.
Reboot the server to make sure everything works as expected.
# reboot
7. Test Zendto by logging using the Web Browser and sending a file attachment and downloading it.
8. Finishing up
The old /var/zendto directory/partition was deliberately left behind, just in case there were problems copying files. After verifying that the system is running smoothly, you can either use the old /var/zendto partition for something else, or remove the /var/zendto.old directory and reclaim the disk space.
Congratulations, you've just moved /var/zendto!
>>> On 9/7/2011 at 2:52 PM, Mathieu Chartier <mchartier at cegepsth.qc.ca> wrote:
I’ve just download and installed the Ubuntun virtual machine of Zendto. Everything is fine but I can’t find how to change the location of the storage for the dropped files….someone can guide me?
Regards.
Mathieu Chartier
Technicien en informatique classe principale
Services administratifs
mchartier at cegepsth.qc.ca
(450)773-6800 ou (514)875-4445 (Montréal et rive-sud), poste 2153
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ecs.soton.ac.uk/pipermail/zendto/attachments/20110908/d7abab1d/attachment-0001.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/jpeg
Size: 5060 bytes
Desc: not available
Url : http://mailman.ecs.soton.ac.uk/pipermail/zendto/attachments/20110908/d7abab1d/attachment-0001.jpe
More information about the ZendTo
mailing list