tilde/blog/raid-nonsense.html

112 lines
4.3 KiB
HTML

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="theme-color" content="#00cc00">
<link rel="icon" type="image/png" sizes="192x192" href="https://tilde.team/apple-touch-icon-precomposed.png">
<link rel="icon" type="image/png" sizes="96x96" href="https://tilde.team/favicon-96x96.png">
<link rel="stylesheet" href="https://tilde.team/css/hacker.css">
<link rel="stylesheet" href="extra.css">
<link rel="alternate" type="application/rss+xml" title="subscribe to this page..." href="feed.rss" />
<title>raid nonsense</title>
</head><body>
<div class="container">
<div id="divbodyholder">
<div class="headerholder"><div class="header">
<div id="title">
<h1 class="nomargin"><a class="ablack" href="https://tilde.team/~ben/blog/index.html">blog // ~ben</a></h1>
<div id="description">a blog about tildes and other things</div>
</div></div></div>
<div id="divbody"><div class="content">
<!-- entry begin -->
<h3><a class="ablack" href="raid-nonsense.html">
raid nonsense
</a></h3>
<!-- bashblog_timestamp: #201901131328.45# -->
<div class="subtitle">January 13, 2019 &mdash;
~ben
</div>
<!-- text begin -->
<p>last week i did some <a href="https://tilde.team/news/?page=025_raid_reboot">maintenance</a>
on the tilde.team box. probably should have written about it sooner but i didn't
make time for it until now.</p>
<hr />
<p>the gist of the problem was that the default images provided by <a href="https://hetzner.com">hetzner</a>
default to raid1 between the available disks. our box has two 240gb SSDs, which
resulted in 200gb usable space for /. it also defaulted to giving us a huge swap
partition which i deem unnecessary for a box with 64gb ram. </p>
<p>the only feasible solution that i've found involved using the rescue system and
the <a href="https://wiki.hetzner.de/index.php/Installimage/en">installimage</a> software
to reconfigure the disk partitions.</p>
<p><a href="https://yourtilde.com/~deepend/">deepend</a> recently upgraded to a beefier dedi
(more threads and more disk space) and had a bit of contract time on the old one.
he offered to let me use it as a staging box for the meantime while i reinstalled
and reconfigured my raid settings.</p>
<p>i've migrated tilde.team twice before (from linode -> woothosting -> hetzner ->
and now back to hetzner on the same box) using a slick little rsync that i've
put together.</p>
<p><code>
rsync -auHxv --numeric-ids \
--exclude=/etc/fstab \
--exclude=/etc/network/* \
--exclude=/proc/* \
--exclude=/tmp/* \
--exclude=/sys/* \
--exclude=/dev/* \
--exclude=/mnt/* \
--exclude=/boot/* \
--exclude=/root/* \
root@oldbox:/* /
</code></p>
<p>as long as the destination and source boxen are running the same distro/version,
you should be good to go after rebooting the destination box!</p>
<p>the only thing to watch out for is running databases. it happened to me this time
with mysql. there were 3 pending transactions that were left open during the
rsync backup. it kept failing to start after i got the box back up, along with
all the other services that depend on it.</p>
<p>eventually i was able to get mysqld back up and running in recovery mode (basically
read-only) and got a mysqldump of all databases. i then purged all existing mysql
data, reinstalled mariadb-server, and restored the mysqldump. everything came up
as expected and we were good to go!</p>
<p>the raid is now in a raid0 config, leaving us with 468gb (not GiB) available
space. thanks for tuning in to this episode of sysadmin adventures!</p>
<p>tags: <a href='tag_tilde.html'>tilde</a>, <a href='tag_sysadmin.html'>sysadmin</a></p>
<!-- text end -->
<!-- entry end -->
</div>
<div id="footer">CC by-nc-nd <a href="https://tilde.team/~ben/">~ben</a> &mdash; <a href="mailto:ben&#64;tilde&#46;team">ben&#64;tilde&#46;team</a><br/>
generated with <a href="https://tildegit.org/team/bashblog">bashblog</a>, a single bash script to easily create blogs like this one</div>
</div></div>
<script src="https://utteranc.es/client.js"
repo="benharri/tilde"
issue-term="title"
crossorigin="anonymous"
theme="github-dark"
async>
</script>
</div>
<br>
</body></html>