Initializing Hard Drive - Linux: Difference between revisions
No edit summary |
No edit summary |
||
Line 21: | Line 21: | ||
To view all disks and retrieve the disk UUID: | To view all disks and retrieve the disk UUID: | ||
<pre>lsblk --fs</pre> | <pre>lsblk --fs</pre> | ||
Add the new drive to the fstab file to allow automatic mounting | |||
<pre>UUID=3df346bc-48d9-4ac7-962a-ad7ead8654b7 /home/media ext4 defaults 0 2</pre> | |||
<pre>mount /home/media</pre> |
Revision as of 22:19, 29 November 2020
Use fdisk to identify new hard drive (use sudo or root)
fdisk -l
For larger disks, make sure the partition table is gpt (vs mbr). This allows for larger and more partitions. To do this:
Using GParted, you can do this by going into Device->Create Partition Table and select "gpt" from the list.
Or parted
sudo aptitude install parted parted /dev/sdb print mklabel gpt mkpart primary ext4 0% 100%
Creating a File System
sudo mkfs.ext4 -L media /dev/sdb1
To view all disks and retrieve the disk UUID:
lsblk --fs
Add the new drive to the fstab file to allow automatic mounting
UUID=3df346bc-48d9-4ac7-962a-ad7ead8654b7 /home/media ext4 defaults 0 2
mount /home/media