# remove all old file system information. Not necessary, but I do it just because I can wipefs -a /dev/sdg # make this a gpt disk. Will wipe out any other partitioning scheme parted /dev/sdg mklabel gpt # make a new partition on optimal sector boundries. This is a primary partition, and starts # at the beginning of the disk (0%) and goes to the end of the disk (100%) # I put that in quotes as, from what I've read, the percent symbol does not work well # within the bash command line # note, we are not telling it what file system to use, so it defaults to Linux parted -a optimal /dev/sdg mkpart primary '0%' '100%' # display the information on the disk parted /dev/sdg print # format as ext4, no reserved space, and a disk label marked 'backup' mkfs.ext4 -m0 -Lbackup /dev/sdg