Last active
December 17, 2015 05:49
-
-
Save TacoSteemers/5560959 to your computer and use it in GitHub Desktop.
Partitioning and mounting a disk on a Debian system
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
What is present? | |
$ fdisk -l | |
To edit the partitions on /dev/sdz: | |
$ fdisk /dev/sdz | |
Follow the instructions. | |
Remove the partitions you want to remove, create new ones in their place. | |
Make sure to verify and write. | |
Then, update the kernel: | |
$ partprobe /dev/sdz | |
Then, create the filesystem(s): | |
$ mkfs.ext4 /dev/sdz1 | |
Then, mount: | |
$ mkdir /media/volz1 | |
$ mount -t ext4 /dev/sdz1 /media/volz1 | |
Add a line like the following to fstab to let it be automounted: | |
/dev/sdz1 /media/volz1 ext4 defaults 0 2 # 2 for quick fs check |
For disks larger than 2TB we need to use a GPT instead of msdos type table. fdisk doesn't support GPT. We use parted instead.
The following shows how to create one large partition on a 3TB disk:
# parted /dev/sdz
(parted) unit TB
(parted) mklabel gpt
(parted) mkpart
Now we follow the instructions, entering 0TB for 'start' and 3TB for 'end'. Thats it.
We print out the partition table to verify:
(parted) print
Note on external disk drive carriers:
Not that you with some drive carriers you can not properly partition or format a large disk drive. It is possible that you will end up with a smaller partition than you had hoped for. If that is the case, you will have to mount it internally instead.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Some of these require administrator rights