Skip to content
Snippets Groups Projects
Commit 45f55c15 authored by John Thiltges's avatar John Thiltges
Browse files

Switch anvil volume guide from fdisk to parted

parent 9f797846
No related branches found
No related tags found
No related merge requests found
Showing
with 18 additions and 37 deletions
......@@ -11,7 +11,7 @@ when it was created, and that you are connected to the [Anvil VPN]({{< relref "
Once you have [created and attached]({{< relref "creating_and_attaching_a_volume" >}})
your volume, it must be formatted and mounted in your Linux instance to be usable. This
procedure is identical to what would be done when attaching a second
hard drive to a physical machine. In this example, a 10GB volume was
hard drive to a physical machine. In this example, a 1GB volume was
created and attached to the instance. Note that the majority of this
guide is for a newly created volume.
......@@ -32,55 +32,36 @@ command `sudo su -` to get a root shell.
{{% panel theme="danger" header="**Running commands as root**" %}}**Extreme care should be taken when running commands as `root.`** It is very easy to permanently delete data or cause irreparable damage to your instance.{{% /panel %}}
{{< figure src="/images/13599376.png" width="700" >}}
{{< figure src="/images/anvil-volumes/1-sudo.png" width="576" >}}
Next, you will need to determine what device the volume is presented as
within Linux. Typically this will be `/dev/vdb`, but it is necessary to
verify this to avoid mistakes, especially if you have more than one
volume attached to an instance. The command `fdisk -l` will list the
hard drive devices.
volume attached to an instance. The command `lsblk` will list the
hard drive devices and partitions.
{{< figure src="/images/13599470.png" width="700" >}}
{{< figure src="/images//anvil-volumes/2-lsblk.png" width="576" >}}
Here there is a completely empty (no partitions) disk device matching
the 10GB size of the volume, so `/dev/vdb` is the correct device.
The `fdisk` utility will first be used to create a single partition.
Run the command `fdisk /dev/vdb` to start the program using the volume
disk device.
the 1GB size of the volume, so `/dev/vdb` is the correct device.
The `parted` utility will first be used to label the device and then create a partition.
{{< figure src="/images/13599477.png" width="700" >}}
Press `n` for new partition and hit enter.
{{< figure src="/images/13599479.png" width="700" >}}
Press `p` for primary partition and hit enter.
{{< figure src="/images/13599482.png" width="700" >}}
Enter `1` for the partition number.
{{< figure src="/images/13599528.png" width="700" >}}
At the next two prompts hit enter to accept the defaults and return to
the main command prompt.
{{< figure src="/images/13599530.png" width="700" >}}
Finally, press `w` followed by return to save the changes and
exit `fdisk`.
{{< highlight bash >}}
parted /dev/vdb mklabel gpt
parted /dev/vdb mkpart primary 0% 100%
{{< /highlight >}}
{{< figure src="/images/13599533.png" width="700" >}}
{{< figure src="/images/anvil-volumes/3-mkpart.png" width="576" >}}
Now that a partition has been created, it can be formatted. Here, the
EXT4 filesystem will be used. This is the default filesystem used by
ext4 filesystem will be used. This is the default filesystem used by
many Linux distributions including CentOS and Ubuntu, and is a good
general choice. An alternate filesystem may be used by running a
different format command. To format the partition using EXT4, run the
different format command. To format the partition using ext4, run the
command `mkfs.ext4 /dev/vdb1`. You will see a progress message and then
be returned to the shell prompt.
{{< figure src="/images/13599540.png" width="700" >}}
{{< figure src="/images/anvil-volumes/4-mkfs.png" width="576" >}}
#### Mounting the volume
......@@ -96,14 +77,14 @@ following commands to make the directory and mount the volume:
{{< highlight bash >}}
mkdir /mnt/myvolume
mnt /dev/vdb1 /mnt/myvolume
mount /dev/vdb1 /mnt/myvolume
{{< /highlight >}}
{{< figure src="/images/13599546.png" width="700" >}}
{{< figure src="/images/anvil-volumes/5-mount.png" width="576" >}}
Running the command `df -h` should then show the new mounted empty
volume.
{{< figure src="/images/13599549.png" width="700" >}}
{{< figure src="/images/anvil-volumes/6-df.png" width="576" >}}
The volume can now be used.
static/images/13599376.png

5.22 KiB

static/images/13599470.png

18.3 KiB

static/images/13599477.png

14.1 KiB

static/images/13599479.png

19.9 KiB

static/images/13599482.png

19.4 KiB

static/images/13599528.png

19.7 KiB

static/images/13599530.png

18.5 KiB

static/images/13599533.png

15.8 KiB

static/images/13599540.png

20 KiB

static/images/13599546.png

5.77 KiB

static/images/13599549.png

10 KiB

static/images/anvil-volumes/1-sudo.png

5.95 KiB

static/images/anvil-volumes/2-lsblk.png

9.45 KiB

static/images/anvil-volumes/3-mkpart.png

13.9 KiB

static/images/anvil-volumes/4-mkfs.png

21.3 KiB

static/images/anvil-volumes/5-mount.png

6.93 KiB

static/images/anvil-volumes/6-df.png

10.7 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment