Help:Adding Disk Space
Wikimedia Cloud documentationThis is a documentation page for Wikimedia Cloud. If you can improve it, please do that. You can also request help on #wikimedia-cloud connect. For all documentation pages, please see the List of all documentation pages for Wikimedia Cloud. If you are seeking a help with a specific project, please contact the project owners.
Cloud VPS instances have a maximum storage quota based on the size of the instance. By default only 20G of the allowed quota is allocated to the instance as the
The additional space is allocated to /srv. If you already have content in /srv, it will be hidden by the new mount. Back up your content before proceeding or see recovery instructions below.
Adding space as a second volume
The additional space can be added to the instance as a separate logical volume. The easiest way to do this is by enabling the
role::labs::lvm::srv Puppet role:
- go to https://horizon.wikimedia.org/project/ ;
- set "
your project" in the project filter;
- find the instance you want to change the in the table below that;
- click on the
Puppet Configurationtab to get to the Puppet management screen for that instance;
- in the row for
labs::lvm::srv, click on the
- in the pop-up, click on the
- wait for the Puppet job to run, OR connect to the instance and run
sudo puppet agent --test --verbose.
After the Puppet run completes you should see a new volume mounted at
/srv. The size of this volume will depend on the amount of remaining quota for your instance.
/srv. directory will be owned by
root., and this will be enforced by puppet.
/srv. is a directory for a collection of local content. Best practice is to create subdirectories for each individual service and give permissions to project members appropriately.
Moving old /srv data to new volume
If you only realized that you need more space after you have put things in the /srv directory of the root partition, follow these basic steps to move that data to the new volume:
- Add the new volume as shown above
mountand make sure the volume is mounted. If it is not force another puppet run.
sudo -sto get a root shell. This will make the next steps easier.
puppet agent --disable 'Moving data from /srv to new volume'
mount /dev/mapper/vd-second--local--disk /mnt
- Copy data from /srv to /mnt with
cd /srv; tar cf - . | (cd /mnt; tar xpvf -)
- Verify that /mnt now has the expected data.
- Remove old data from /srv with
cd /srv; rm -rf *
cd; umount /mnt
mount /dev/mapper/vd-second--local--disk /srv
- Verify that mount worked with
mountand by examining /srv
puppet agent --enable
puppet agent --test --verboseto make sure things stay as expected
Resize root partition
See Help:Resize root partition for an explanation of how to attempt to resize the
/ volume for an existing instance.