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 (gvinum/gconcat) == (parts to change are <span style="color:red">highlighted</span>) 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 [[#js|js]]. 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>[[#stopjail|stopjail]] <hostname></tt> 4. <tt>[[#g|g]] <customerID></tt> to get the info (IP/cust#) needed to feed the new mount name and existing volume/device. 5a. When there's enough room to place new system on an alternate, or the same drive (using only UNUSED - including if it's in use by the system in question - gvinum volumes): Configure the new device:<br> A. for a 2G system (single gvinum volume):<br> <tt>bsdlabel -r -w /dev/gvinum/v<span style="color:red">123</span><br> newfs /dev/gvinum/v<span style="color:red">123</span>a</tt><br> -or- B. for a >2G system (create a gconcat volume):<br> try to grab a contiguous block of gvinum volumes. gconcat volumes MAY NOT span drives (i.e. you cannot use a gvinum volume from data3 and a volume from data2 in the same gconcat volume). <tt>gconcat label <span style="color:red">v82-v84 /dev/gvinum/v82 /dev/gvinum/v83 /dev/gvinum/v84</span><br> bsdlabel -r -w /dev/concat/<span style="color:red">v82-v84</span><br> newfs /dev/concat/<span style="color:red">v82-v84</span>a</tt> Other valid gconcat examples:<br> <tt>gconcat label v82-v84v109v112 /dev/gvinum/v82 /dev/gvinum/v83 /dev/gvinum/v84 /dev/gvinum/v109 /dev/gvinum/v112<br> gconcat label v82v83 /dev/gvinum/v82 /dev/gvinum/v83</tt> <br> Note, long names will truncate: v144v145v148-v115 will truncate to v144v145v148-v1 (so you will refer to it as v144v145v148-v1 thereafter) Optional- if new volume is on a different drive, move the mount point directory (get the drive from js output) 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> confirm you are mounted to the device (<tt>/dev/gvinum/v<span style="color:red">123</span>a</tt> OR <tt>/dev/concat/<span style="color:red">v82-v84</span></tt>) and space is correct:<br> A. <tt>mount /dev/gvinum/v<span style="color:red">123</span>a /mnt/data<span style="color:red">3/69.55.234.66-col01334-DIR</span></tt> <br> -or-<br> B. <tt>mount /dev/concat/<span style="color:red">v82-v84</span>a /mnt/data<span style="color:red">3/69.55.234.66-col01334-DIR</span></tt> <tt>cd /mnt/data<span style="color:red">3/69.55.234.66-col01334-DIR</span> <br> df .</tt> do the dump and pipe directly to restore:<br> <tt>dump -0a -f - /dev/gvinum/v<span style="color:red">1</span> | restore -r -f - <br> rm restoresymtable</tt> when dump/restore completes successfully, use df to confirm the restored data size matches the original usage figure edit quad (<tt>vq<span style="color:red">1</span></tt>) to point to new (/mnt/data<span style="color:red">3</span>) location AND new volume (<tt>/dev/gvinum/v<span style="color:red">123</span>a</tt> or <tt>/dev/concat/<span style="color:red">v82-v84</span>a</tt>) , run <tt>buildsafe</tt> restart the jail:<br> <tt>startjail <hostname></tt> 5b. 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 (i.e. if you want/need to reuse the existing gvinum volumes and add on more): mount backup nfs mounts:<br> <tt>mbm</tt> <br> (run df 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/<span style="color:red">gconcat/v106-v107</span></tt><br> (when complete WITHOUT errors, du the dump file to confirm it matches size, roughly, with usage) unconfigure the old gconcat volume<br> list member gvinum volumes: <tt>gconcat list <span style="color:red">v106v107</span></tt> Output will resemble:<br> <pre>Geom name: v106v107 State: UP Status: Total=2, Online=2 Type: AUTOMATIC ID: 3530663882 Providers: 1. Name: concat/v106v107 Mediasize: 4294966272 (4.0G) Sectorsize: 512 Mode: r1w1e2 Consumers: 1. Name: gvinum/sd/v106.p0.s0 Mediasize: 2147483648 (2.0G) Sectorsize: 512 Mode: r1w1e3 Start: 0 End: 2147483136 2. Name: gvinum/sd/v107.p0.s0 Mediasize: 2147483648 (2.0G) Sectorsize: 512 Mode: r1w1e3 Start: 2147483136 End: 4294966272</pre> stop volume and clear members<br> <tt>gconcat stop <span style="color:red">v106v107</span><br> gconcat clear <span style="color:red">gvinum/sd/v106.p0.s0 gvinum/sd/v107.p0.s0</span></tt> create new device- and its ok to reuse old/former members<br> try to grab a contiguous block of gvinum volumes. gconcat volumes MAY NOT span drives (i.e. you cannot use a gvinum volume from data3 and a volume from data2 in the same gconcat volume). <br> <tt>gconcat label <span style="color:red">v82-v84v106v107 /dev/gvinum/v82 /dev/gvinum/v83 /dev/gvinum/v84 /dev/gvinum/v106 /dev/gvinum/v107</span> <br> bsdlabel -r -w /dev/concat/<span style="color:red">v82-v84v106v107</span><br> newfs /dev/concat/<span style="color:red">v82-v84v106v107</span>a</tt> Optional- if new volume is on a different drive, move the mount point directory (get the drive from js output) 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> confirm you are mounted to the device (/dev/concat/<span style="color:red">v82-v84v106v107</span>) and space is correct:<br> <tt>mount /dev/concat/<span style="color:red">v82-v84v106v107</span>a /mnt/data<span style="color:red">3/69.55.234.66-col01334-DIR</span></tt> <tt>cd /mnt/data<span style="color:red">3/69.55.234.66-col01334-DIR</span> <br> 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 edit quad (<tt>vq<span style="color:red">1</span></tt>) to point to new (/mnt/data<span style="color:red">3</span>) location AND new volume (<tt>/dev/concat/<span style="color:red">v82-v84v106v107</span>a</tt>), run buildsafe restart the jail:<br> <tt>startjail <hostname></tt> TODO: clean up/clear old gvin/gconcat vol 6. update disk (and dir if applicable) in mgmt screen 7. 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> DEPRECATED - steps to tack on a new gvin to existing gconcat- leads to corrupted fs bsdlabel -e /dev/concat/v82-v84 To figure out new size of the c partition, multiply 4194304 by the # of 2G gvinum volumes and subtract the # of 2G volumes: 10G: 4194304 * 5 β 5 = 20971515 8G: 4194304 * 4 β 4 = 16777212 6G: 4194304 * 3 β 3 = 12582909 4G: 4194304 * 2 β 2 = 8388606 To figure out the new size of the a partition, subtract 16 from the c partition: 10G: 20971515 β 16 = 20971499 8G: 16777212 β 16 = 16777196 6G: 12582909 β 16 = 12582893 4G: 8388606 β 16 = 8388590 Orig: 8 partitions: # size offset fstype [fsize bsize bps/cpg] a: 8388590 16 4.2BSD 2048 16384 28552 c: 8388606 0 unused 0 0 # "raw" part, don't edit New: 8 partitions: # size offset fstype [fsize bsize bps/cpg] a: 12582893 16 4.2BSD 2048 16384 28552 c: 12582909 0 unused 0 0 # "raw" part, don't edit sync; sync growfs /dev/concat/v82-v84a fsck βfy /dev/concat/v82-v84a sync fsck βfy /dev/concat/v82-v84a (keep running fsckβs till NO errors)
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