Talk:Gallery:Appliance - Gallery Codex
Personal tools

Talk:Gallery:Appliance

From Gallery Codex

Additional Disk Space in Gallery Appliance

Here's a recipe to get more room for your pictures in the gallery appliance. Hope this helps somebody. (BTW: I love this appliance, thank you for putting it together.)

The insufficient disk space problem of the gallery appliance has been discussed in the forums some time ago. There weren't many suggestions other than making the next release with a larger virtual disk space. I would like to suggest another solution: moving the gallery data folder to a second virtual disk.

Vmware server supports additional disks for the virtual appliances, and it is very easy to set up a disk at your liking.

Here is what I did to move my gallery data to a brand new 8GB virtual disk:

1. Stop the Gallery Appliance from Vmware Server console.

2. Go to VM --> Settings --> Hardware --> Add and add an SCSI disk to your virtual machine. If you chose to add IDE drive, then replace each sda with hdb in the rest of the steps.

3. Add the disk to your Gallery. Fire up your appliance and login as root. See if your disk is there:

[root@localhost ~]# ls /dev/sd*
/dev/sda 

4. Make sure that the new disk is empty:

[root@localhost ~]# fdisk /dev/sda

Command (m for help): p

Disk /dev/sda: 6442 MB, 6442450944 bytes
255 heads, 63 sectors/track, 783 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System

5. Create a new partition on the disk, choose n, p, and 1:

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
       Partition number (1-4): 1

#Use default values for the cylinders

6. To see the partition table, choose p. Then use w to write it on disk.

Command (m for help): p

Disk /dev/sda: 6442 MB, 6442450944 bytes
255 heads, 63 sectors/track, 783 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1         783     6289416   83  Linux

7. Now format the new partition with ext3 and create a mountpoint for your drive:

[root@localhost ~]# mkfs -t ext2 -j /dev/sda1 
[root@localhost ~]# mkdir /mnt/sda1

8. Edit your fstab with nano /etc/fstab to reflect the new drive by adding the following line:

/dev/sda1               /mnt/sda1               ext3    defaults        2 1

9. Now you should be able to mount the new drive manually without problems, and it will mount itself at the next boot:

[root@localhost ~]# mount /mnt/sda1

10. Copy your gallery2 data directory to the new drive along with the file permissions:

[root@localhost ~]# /etc/init.d/httpd stop
[root@localhost ~]# cp -rp /var/lib/gallery2data /mnt/sda1/
[root@localhost ~]# mv /var/lib/gallery2data /var/lib/gallery2data.old
[root@localhost ~]# ln -s /mnt/sda1/gallery2data /var/lib/
[root@localhost ~]# /etc/init.d/httpd start

Your gallery2 server shouldn't feel anything :)