Format and mount USB in Linux
Suppose you have a completely new 4TB hard drive recently and want to add it to your computer. You need to mount it in Linux. To do this, you need to take the following steps:
- A. Partitioning the hard drive in Linux
- B. Format USB in Linux
- C. Mount USB in Linux (including auto mount after reboot)
- D. Check if the hard drive is mounted
A. Partitioning the hard drive in Linux
Step 1 : First, after connecting the hard drive to the computer with a SATA cable and power cable, you can test the new 4TB hard drive with the command:
sudo fdisk -l
Step 2 : But you cannot mount it now, if you mount it immediately, an error will appear. You need to partition it first:
sudo fdisk /dev/sdb
Step 3 : If you enter m
for help, you can see the command list.
Step 4 : To check the partition table, enter p
.
Step 5 : To partition, enter n
. For example then simply select the primary partition by entering p
and entering 1
for only some partitions.
Step 6 : Enter w
to write the partition table to the drive.
B. Format USB in Linux
The USB format in Ubuntu with the Terminal command is much easier than in Windows. But some Ubuntu users are not familiar with Terminal commands. This tutorial will help Ubuntu users (Linux) take simple steps to format USB.
Step 1 : Insert the USB and determine the volume
Insert the USB into the system and determine the correct USB drive. This is a step you need to take care of, because you can format the drive incorrectly if your drive is not correctly identified.
$ df -h Filesystem Size Used Avail Use% Mounted on /dev/sda1 28G 24G 2.3G 92% / udev 1.4G 12K 1.4G 1% /dev tmpfs 277M 1.2M 276M 1% /run none 5.0M 0 5.0M 0% /run/lock none 1.4G 34M 1.4G 3% /run/shm /dev/sdc1 14.8G 1.4G 13.4G 10% /media/tecadmin
Now, the example has determined the drive / dev / sdc1 is a 16GB USB attached.
Step 2 : Format USB in Linux
Whenever you mount USB in Ubuntu, it will automatically mount to the system. You cannot format any drive on mounted Linux systems. So first unmount the USB drive / dev / sdc1 on the system.
sudo umount /dev/sdc1
Now, use one of the following commands on the file system you want. To format USB, most users prefer VFAT and NTFS file systems because they can be easily used on Windows operating systems.
- Format with vFat file system:
sudo mkfs.vfat /dev/sdc1
- Format with NTFS file system:
sudo mkfs.ntfs /dev/sdc1
- Format with EXT4 file system:
sudo mkfs.ext4 /dev/sdc1
Similarly, you can format the USB flash drive with any required file system.
C. Mount USB in Linux (including auto mount after reboot)
Step 1 : Normally, the hard drive is mounted in / mnt /. Create a new folder in / mnt / first.
sudo mkdir /mnt/sdb
Step 2 : After that, you can mount it with the command:
sudo mount /dev/sdb /mnt/sdb
Step 3 : But you need to mount it every time you reboot. To automatically mount after every reboot, we will use nano to modify the / etc / fstab file:
nano /etc/fstab
Step 4 : Enter the following command at the end of the file:
/dev/sdb /mnt/sdb ext4 defaults 0 0
The first item is the path for the hard drive. The second is the destination of the mounted drive (where you want to mount the drive). The third is the format. The fourth to sixth items remain the same by default of 0 and 0 .
D. Check if the hard drive is mounted
There are 3 methods to test. All three methods can find the sdb mounted hard drive.
1. mount
mount | grep sdb
2. lsblk
lsblk
3. df
df
Hope you are succesful.
You should read it
- How to mount the hard drive and partition using the Linux command line
- How to mount a Linux file system using WSL2 on Windows 10
- How to mount remote directory in Linux with SSHFS
- How to Create and Use ISO Files on Linux
- How to Remove a TV from a Mount
- How to format a storage drive using Linux Terminal
- How to format a hard drive into NTFS in Linux
- Add the option to Mount right-click menu in Windows 8
- How to Format a Linux Hard Disk to Windows
- Instructions for installing basic Arch Linux
- How to mount a folder as a virtual drive on Windows
- How to use pandoc to convert files on Linux
Maybe you are interested
Driver Talent - Free Driver Updater
Intel releases new driver update package with 6GHz optimization and many other improvements
Run Linux from USB Flash Drive
How to recover deleted Viber messages using Google Drive, iCloud
How to remove driver, delete driver in Windows 10, 11
How to reinstall audio driver on Windows 10, 11