Mount an external disk to Linux

From Logic Wiki
Jump to: navigation, search


Create a folder

sudo mkdir /media/MyNewDisk

Mount NTFS filesystem

sudo mount -t ntfs-3g /dev/sdb1 /media/MyNewDisk

or if it's not NTFS

sudo mount /dev/sdb1 /media/MyNewDisk

Formatting the USB

You should unmount the device first to format the USB device, then use the following command to unmount the device –

$ sudo umount /dev/sdb1

Now use either of the commands as per file system based on your requirement. To format a USB drive, users generally prefer VFAT or NTFS file systems because they can be easily mounted on Windows operating systems and Linux systems.

Format vs Fat FileSystem

To format USB with vFat File System, use the following command –

$ sudo mkfs.vfat /dev/sdb1

Format NTFS FileSystem

To format a USB Flash Drive with NTFS file system, use the following command –

$ sudo mkfs.ntfs /dev/sdb1

Format EXT4 FileSystem

To format a USB with EXT4 file system, use the following command –

$ sudo mkfs.ext4 /dev/sdb1