summaryrefslogtreecommitdiffstats
path: root/content/posts/gpt-formatting-drives-under-linux.md
diff options
context:
space:
mode:
authorbreadcat2020-06-19 12:23:15 +0100
committerbreadcat2020-06-19 12:23:15 +0100
commit70bb5d5a801428b0fb390abf79f19ffcf5e29c67 (patch)
treeb9fd7990156bd58bc38d58f91829c05933215102 /content/posts/gpt-formatting-drives-under-linux.md
parent0f9a31348079c0a061bcc194912e75cc1c07bc1f (diff)
downloadblog.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/gpt-formatting-drives-under-linux.md')
-rw-r--r--content/posts/gpt-formatting-drives-under-linux.md42
1 files changed, 42 insertions, 0 deletions
diff --git a/content/posts/gpt-formatting-drives-under-linux.md b/content/posts/gpt-formatting-drives-under-linux.md
new file mode 100644
index 0000000..61de0b7
--- /dev/null
+++ b/content/posts/gpt-formatting-drives-under-linux.md
@@ -0,0 +1,42 @@
+---
+title: "GPT formatting new drives under Linux"
+date: 2018-11-14T10:42:00
+tags: ["guides", "linux", "servers", "snippets"]
+---
+
+So, you've bought a shiny new hard drive and would like to format it and use it on your headless Linux server.
+For this guide, we'll be partitioning it as a GPT partition to support sizes over 2TB, and formatting it as ext4.
+
+Find device id (/dev/sdc, etc):
+```
+lsblk
+```
+
+Edit the drive, using fdisk in GPT mode with:
+```
+sudo gdisk /dev/sdc
+d
+n
+[enter] x5
+w
+```
+
+Make a partition:
+```
+sudo mkfs.ext4 /dev/sdc1
+```
+
+Verify everything formatted correctly:
+```
+lsblk --fs /dev/sdc1
+```
+
+Find the drives new UUID:
+```
+blkid /dev/sdc1
+```
+
+Lastly, add a mountpoint to `/etc/fstab`:
+```
+UUID=00000000-0000-0000-0000-000000000000 /mnt/mount-point ext4 defaults 0 0
+```