Editing
VPS Management
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Moving customer to a different drive (md) == NOTE: this doesn’t apply to mx2 which uses gvinum. Use same procedure as 6.x NOTE: if you unmount before mdconfig, re-mdconfig (attach) then unmount then mdconfig -u again (parts to change/customize are <tt><span style="color:red">red</span></tt>) If someone wants more disk space, there’s a paste for it, send it to them (explains about downtime, etc). 1. Figure out the space avail from <tt>js</tt>. Ideally, you want to put the customers new space on a different partition (and create the new md on the new partition). 2. make a mental note of how much space they're currently using 3. <tt>jailkill <hostname></tt> 4. Umount it (including their devfs) but leave the md config’d (so if you use stopjail, you will have to re-mdconfig it) 5. <tt>g <customerID></tt> to get the info (IP/cust#) needed to feed the new mdfile and mount name, and to see the current md device. 6a. When there's enough room to place new system on an alternate, or the same drive: USE CAUTION not to overwrite (touch, mdconfig) existing md!!<br> <tt>touch /mnt/data<span style="color:red">3/69.55.234.66-col01334</span><br> mdconfig -a -t vnode -s 10g -f /mnt/data3/69.55.234.66-col01334 -u 97<br> newfs /dev/md97</tt> Optional- if new space is on a different drive, move the mount point directory AND use that directory in the mount and cd commands below:<br> <tt>mv /mnt/data<span style="color:red">1/69.55.234.66-col01334-DIR</span> /mnt/data<span style="color:red">3/69.55.234.66-col01334-DIR</span></tt> <tt>mount /dev/md<span style="color:red">97</span> /mnt/data<span style="color:red">3/69.55.234.66-col01334-DIR</span> <br> cd /mnt/data<span style="color:red">3/69.55.234.66-col01334-DIR</span></tt> confirm you are mounted to /dev/md<span style="color:red">97</span> and space is correct:<br> <tt>df .</tt> do the dump and pipe directly to restore:<br> <tt>dump -0a -f - /dev/md<span style="color:red">1</span> | restore -r -f - <br> rm restoresymtable</tt> when dump/restore completes successfully, use <tt>df</tt> to confirm the restored data size matches the original usage figure md-unconfig old system:<br> <tt>mdconfig -d -u <span style="color:red">1</span></tt> archive old mdfile. <br> <tt>mv /mnt/data<span style="color:red">1/69.55.237.26-col00241</span> /mnt/data<span style="color:red">1/old-col00241-mdfile-noarchive-20091211</span></tt> edit quad (vq1) to point to new (/mnt/data<span style="color:red">3</span>) location AND new md number (md<span style="color:red">97</span>) restart the jail:<br> <tt>startjail <hostname></tt> 6b. When there's not enough room on an alternate partition, or on the same drive...but there is enough room if you were to remove the existing customer's space: mount backup nfs mounts:<br> <tt>mbm</tt><br> (run <tt>df</tt> to confirm backup mounts are mounted) dump the customer to backup2 or backup1<br> <tt>dump -0a -f /backup<span style="color:red">4/col00241.20120329.noarchive.dump</span> /dev/md<span style="color:red">1</span></tt><br> (when complete WITHOUT errors, <tt>du</tt> the dump file to confirm it matches size, roughly, with usage) unconfigure and remove old mdfile<br> <tt>mdconfig -d -u <span style="color:red">1</span><br> rm /mnt/data<span style="color:red">1/69.55.237.26-col00241</span></tt><br> (there should now be enough space to recreate your bigger system. If not, run sync a couple times) create the new system (ok to reuse old mdfile and md#):<br> <tt>touch /mnt/data<span style="color:red">1/69.55.234.66-col01334</span><br> mdconfig -a -t vnode -s <span style="color:red">10</span>g -f /mnt/data<span style="color:red">1/69.55.234.66-col01334</span> -u <span style="color:red">1</span><br> newfs /dev/md<span style="color:red">1</span><br> mount /dev/md<span style="color:red">1</span> /mnt/data<span style="color:red">1/69.55.234.66-col01334-DIR</span> <br> cd /mnt/data<span style="color:red">1/69.55.234.66-col01334-DIR</span></tt> confirm you are mounted to /dev/md<span style="color:red">1</span> and space is correct:<br> <tt>df .</tt> do the restore from the dumpfile on the backup server:<br> <tt>restore -r -f /backup<span style="color:red">4/col00241.20120329.noarchive.dump</span> .<br> rm restoresymtable</tt> when dump/restore completes successfully, use df to confirm the restored data size matches the original usage figure umount nfs:<br> <tt>mbu</tt> If md# changed (or mount point), edit quad (<tt>vq1</tt>) to point to new (/mnt/data<span style="color:red">3</span>) location AND new md number (md<span style="color:red">1</span>) restart the jail:<br> <tt>startjail <hostname></tt> 7. update disk (and dir if applicable) in mgmt screen 8. update backup list AND move backups, if applicatble Ex: <tt>mvbackups <span style="color:red">69.55.237.26-col00241</span> jail<span style="color:red">9</span> data<span style="color:red">3</span></tt> 9. Optional: archive old mdfile <tt>mbm<br> gzip -c old-col01588-mdfile-noarchive-20120329 > /deprecated/old-col01588-mdfile-noarchive-20120329.gz<br> mbu<br> rm old-col01588-mdfile-noarchive-20120329</tt>
Summary:
Please note that all contributions to JCWiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
JCWiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information