Initializing Hard Drive - Linux: Difference between revisions

No edit summary
No edit summary
Line 15: Line 15:
mkpart primary ext4 0% 100%
mkpart primary ext4 0% 100%
</pre>
</pre>
To view all disks
<pre>lsblk</pre>


Creating a File System
Creating a File System
<pre>sudo mkfs.ext4 -L media /dev/sdb1</pre>
<pre>sudo mkfs.ext4 -L media /dev/sdb1</pre>
To view all disks and retrieve the disk UUID:
<pre>lsblk --fs</pre>

Revision as of 22:10, 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