#!/bin/bash # List Drives: # $> lsblk # # List Drive UUID: # $> blkid # # Umount Disk: # $> umount device/directory # # Format Drive: # $> mkfs [options] [-t type fs-options] device [size] lsblk # Target Device /dev/sda1 # NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS # sda 8:0 0 1.8T 0 disk # `-sda1 8:1 0 1.8T 0 part /media/T7 sudo umount -f /dev/sda1 sudo mkfs -t ext4 /dev/sda1 # Creating filesystem with 488377976 4k blocks and 122101760 inodes # Filesystem UUID: eabf0e8b-2355-4bda-91d6-6390d9eaa3a7 # Superblock backups stored on blocks: # 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, # 4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, # 102400000, 214990848 # Allocating group tables: done # Writing inode tables: done # Creating journal (262144 blocks): done # Writing superblocks and filesystem accounting information: done blkid # Target Device /dev/sda1 # /dev/sda1: UUID="eabf0e8b-2355-4bda-91d6-6390d9eaa3a7" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="7c7cb417-01" echo "UUID=eabf0e8b-2355-4bda-91d6-6390d9eaa3a7 /data ext4 defaults 0 0" >> /etc/fstab # Adds the Drive to the fstab File systemctl daemon-reload mkdir /data mount -a # Reloads the Daemon and mounts the Drive under /data