diff options
author | breadcat | 2020-06-19 12:23:15 +0100 |
---|---|---|
committer | breadcat | 2020-06-19 12:23:15 +0100 |
commit | 70bb5d5a801428b0fb390abf79f19ffcf5e29c67 (patch) | |
tree | b9fd7990156bd58bc38d58f91829c05933215102 /content/posts/manually-formatting-mounting-and-using-hetzner-volumes.md | |
parent | 0f9a31348079c0a061bcc194912e75cc1c07bc1f (diff) | |
download | blog.minskio.co.uk-70bb5d5a801428b0fb390abf79f19ffcf5e29c67.tar.gz blog.minskio.co.uk-70bb5d5a801428b0fb390abf79f19ffcf5e29c67.tar.bz2 blog.minskio.co.uk-70bb5d5a801428b0fb390abf79f19ffcf5e29c67.zip |
Simple migration of existing posts to hugo format
Diffstat (limited to 'content/posts/manually-formatting-mounting-and-using-hetzner-volumes.md')
-rw-r--r-- | content/posts/manually-formatting-mounting-and-using-hetzner-volumes.md | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/content/posts/manually-formatting-mounting-and-using-hetzner-volumes.md b/content/posts/manually-formatting-mounting-and-using-hetzner-volumes.md new file mode 100644 index 0000000..4a18bf2 --- /dev/null +++ b/content/posts/manually-formatting-mounting-and-using-hetzner-volumes.md @@ -0,0 +1,60 @@ +--- +title: "Manually formatting, mounting and using Hetzner volumes" +date: 2019-07-04T15:40:00 +tags: ["formats", "linux", "servers", "snippets", "software"] +--- + +I've recently moved all my server infrastructure over to Hetzner, and to date everything's been going swimmingly. + +The default partition options though aren't ideal, so I'm scrapping my existing volume and recreating it manually, properly. + +Firstly, login to your Hetzner account and create your volume: + +``` +Volumes > Create Volume > Size in GB +Name whatever +Mount options Manual +Create & Buy Now +``` + +Now find the partition after logging into your server via issuing `lsblk`. In my case, this was `/dev/sdb` + +You can now partition this new drive as a GPT volume by doing the following: +``` +gdisk /dev/sdb +o +n +enter +enter +enter +w +enter +``` + +One partitioned, you can format this new partition as ext4, via the following: +``` +sudo mkfs.ext4 /dev/sdb1 +``` +Seeing as though I'm going to be using this partition as extra storage for downloaded files I don't really need the reserved blocks it offers, which can be disabled via: +``` +sudo tune2fs -m0 /dev/sdb1 +``` + +Now, we'll make a mount point for the newly formatted volume: +``` +mkdir $HOME/mountpoint +``` + +It's also worthwhile grabbing the disk's UUID via `sudo blkid /dev/sdb1 -s UUID -o value`. + +Now we're going to add an entry in `/etc/fstab` so the partition will be mounted automatically. You'll need to edit this file as root and add the following line: +``` +UUID=your-uuid-from-above /home/youruser/mountpoint ext4 discard,nofail,defaults 0 0 +``` + +Now that your `fstab` file is ammended, you can remount all your partitions via: `sudo mount -a` + +Last but not least, change the owner of the directory to prevent file permission issues: +``` +sudo chown youruser:youruser /home/user/mountpoint -R +``` |