--- title: "Format, and Mount a Disk in Linux - Intermediate" slug: "format-and-mount-a-disk-in-linux-intermediate" updated: 2026-07-13T03:08:15Z published: 2026-07-13T03:08:15Z canonical: "docs.serversaustralia.com.au/format-and-mount-a-disk-in-linux-intermediate" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.serversaustralia.com.au/llms.txt > Use this file to discover all available pages before exploring further. # Format, and Mount a Disk in Linux - Intermediate The below article will assume that you have one of the following hardware configurations: 1. A stand-alone drive which presents itself to the OS as a device name *(like /dev/sdc for example)* 2. A RAID Array configured on a RAID device, which presents itself to OS as a device name *(like /dev/sdc for example)* Use the below command to initiate **fdisk** for formatting the disk. ***Note: If the disk is over 3TB, and you're running an older version of FDISK, you'll need to use "parted" instead.*** ```shell root@server:~# fdisk /dev/sdc ``` Now we'll be presented with an **fdisk** shell on our console. We want to view the current disk's information to see if it's empty. In the example below it's a 480GB SSD drive and we’re using **‘p’** to print the information on-screen: ```shell Command (m for help): p Disk /dev/sdc: 480.1 GB, 480103981056 bytes 255 heads, 63 sectors/track, 58369 cylinders, total 937703088 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x80ed6cbb Device Boot Start End Blocks Id System ``` We've now confirmed we have the right disk, so we’ll move towards creating a partition. Below, you'll find the commands necessary to create a simple full-size partition. (**__ denotes "default value - Press Enter")** ```shell Command (m for help): n Partition type: p primary (0 primary, 0 extended, 4 free) e extended Select (default p): p Partition number (1-4, default 1): __ Using default value 1 First sector (2048-937703087, default 2048): __ Using default value 2048 Last sector, +sectors or +size{K,M,G} (2048-937703087, default 937703087): Using default value 937703087 ``` Check the partition has shown up correctly: ```shell Command (m for help): p Disk /dev/sdc: 480.1 GB, 480103981056 bytes 255 heads, 63 sectors/track, 58369 cylinders, total 937703088 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x80ed6cbb Device Boot Start End Blocks Id System /dev/sdc1 2048 937703087 468850520 83 Linux ``` Everything is looking good based on the information we’ve seen, now we will go ahead and "**WRITE**" it to apply the changes to the disk directly: ```shell Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks. ``` So now we have our partition; we want to create an EXT4 Filesystem on it specifically for our example. ```shell root@server:~# mkfs.ext4 /dev/sdc1 mke2fs 1.42 (29-Nov-2011) Discarding device blocks: done Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) Stride=0 blocks, Stripe width=0 blocks 29310976 inodes, 117212630 blocks 5860631 blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks=4294967296 3578 block groups 32768 blocks per group, 32768 fragments per group 8192 inodes per group Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 102400000 Allocating group tables: done Writing inode tables: done Creating journal (32768 blocks): done Writing superblocks and filesystem accounting information: done ``` Now that the filesystem has been created, we will move ahead with the next steps required and locate the disk's UUID, create a mount point, mount it, and configure it for mounting on boot. In the example below we can locate our Disk UUID. We will only need **UUID="9262f711-a6ba-4aad-dac4-a73eb92225e0"** from the below example (your output will be different): ```shell root@server:~# blkid /dev/sdc1 /dev/sdc1: UUID="9262f711-a6ba-4aad-dac4-a73eb92225e0" TYPE="ext4" ``` We're going to configure to auto-mount it to a folder titled **"/db2"** in the root file directory of the operating system. Below is a default value. You will need to set the UUID (as shown above), mount point, and filesystem type. ```shell root@server:~# echo "UUID=9262f711-a6ba-4aad-dac4-a73eb92225e0 /db2 ext4 defaults 0 0" >> /etc/fstab ``` Now we want to create the mount point and mount our new drive: ```shell root@server:~# mkdir /db2 root@server:~# mount /db2 ``` As you can see below, it's now mounted, and available in the below directory: ```shell root@server:~# df -h /db2 Filesystem Size Used Avail Use% Mounted on /dev/sdc1 441G 199M 418G 1% /db2 ``` ``