#! /bin/bash # Script to format an external hard disk /dev/sdb into XFS format and then mount it to a directory /export # 1. Check out the label for the hard disks using fdisk -l. Let the hard disk be $hd fdisk -l hd=/dev/sdb # Format the hard disk forcefully into XFS format mkfs.xfs -f $hd mkdir /export chmod -R 777 /export mount -t xfs $hd /export # Mount the 1 TiB hardisk permanantlty cp /etc/fstab /etc/fstab.orig cat $hd ' /export xfs rw 2 2' > /etc/fstab # The permanant mount of /dev/sdb to /export will take place only after a reboot