Hello all,
I want to split up my BOA install so that /data lives in another partition/disk within my Linode.
I see many approaches...:
... but I just wanted to double check there's nothing I've forgotten. My rough plan, minus commands, is...
- Create a /data.new directory to hold the old /data folder
- Add a new Linode partition (~10Gb)
- Mount it at /data.new, update fstab
- Stop NGINX and MYSQL
- Copy everything from /disk to /disk.new (either with 'cp -af' or tar [some magic])
- Rename /disk to disk.old
- unmount /disk.new and rename/re-mount it at /disk, update fstab
- Restart NGINX and MYSQL, pray, test
- Attempt an out-of-hours restart to double-check the auto-mount works
So what do you think? This is a live webserver running a BOA setup so a little downtime is ok, but I don't want to break it!
I'll be importing more sites and expanding its capacity soon, hence the need to want to give the sites space to grow without losing the ability to just backup the whole image if needs be -- or send web data to another Linode and leave this one running email and databases.
Is approach a good one? Your ideas, commands, scripts or other tips warmly welcomed.
Thanks, Jim

Comments
Pantheon Valhalla filesystem
It would be great if something was able to be build similar to Pantheon's Valhalla file system.
https://getpantheon.com/news/inside-pantheon-valhalla-filesystem
Seems like an extremely valuable and useful piece of software for Drupal.
First add your new mount
First add your new mount point like
/var/whateverto theopen_basedirlist in the/opt/etc/php.inifile, runservice php-fpm reloadand thentouch /opt/etc/custom.php.inito avoid overwriting in on Barracuda upgrade. Next you could simply mount new disk/partition at/var/whatever, thenmv /data /var/whatever/. When it is complete, typeln -s /var/whatever/data /data. The only downtime will be whenmvcommand will delete/datadirectory, not while it is runningcp -afor you behind the scenes. There is no need to restart Nginx or MySQL. It is tested and working, simple how-to.Great, thank you
I'll give this a go soon, thank you very much for the tips.
Reporting back -- a tip and a minor pitfal
I did it last night with some variations and minor issues... In the interests of expanding this how-to I did the following:
/mnt/diskinstead of/var/whateverbecause/mntwas already set in the 'open_basedir' variable in/opt/etc/php.inithat Barracuda set up... This way I can get updates to php.ini during Barracuda upgrades seamlessly with no override faff.mkdir /mnt/diskfollowed by amount -t ext3 /dev/xvdd /mnt/datato mount the disk device into the new folder./etc/fstabas followsso the mount is recreated after reboots.
mv /data/* /mnt/data/which unfortunately deleted each subdir right after it was copied, so there was a little more downtime than I'd hoped. Had a moment of paranoia and added the *, which caused this minor issue.mv /data /mnt/data ; ln -s /mnt/data /dataso there was no gap between the move and re-linking the directory.So thanks Grace, this works well. My use of /mnt instead means I can get php.ini enhancements with each Barracuda updates, which keeps things simple and is a tip worth passing on to others I reckon.
Next I'd like to move the regularly changing/bloating stuff (like NginX's speed cache, other bits in /var, /tmp etc.) to another disk and then I can back up only what's needed. I'll use roughly the same processes again.