Mounting a Linux Partition on an External Drive in Linux
If you’re a Linux user, chances are you’ve come across situations where you need to access data on an external disk plugged in via USB. In many cases, these disks will contain Linux partitions, and you may need to mount them in order to access the data. In this guide, we’ll show you how to mount a Linux partition on an external disk in Linux.
Step 1: Plug in the external disk
The first step is to plug in the external disk via USB. Once you’ve done that, open a terminal window on your Linux system.
Step 2: List available block devices
Next, use the lsblk
command to list all available block devices on your system. This will show you a list of all available disks and partitions on your system, including the external disk you just plugged in. To do this, simply type lsblk
into the terminal and hit enter.
lsblk
Step 3: Identify the partition to mount
Identify the partition you want to mount. It will typically be labeled as “Linux” or “ext4”. Note down the device name of the partition you want to mount, as we’ll need it in the next step.
Step 4: Create a mount point
Create a mount point directory where you want to mount the partition. For example, you can create a directory named “mydisk” in your home directory. To do this, type the following command into the terminal:
mkdir ~/mydisk
Step 5: Mount the partition
Now, we can use the mount
command to mount the partition. Replace /dev/sdX1
with the actual device name of the partition you want to mount, and replace /path/to/mount/point
with the path to the mount point directory you created in step 4.
sudo mount /dev/sdX1 /path/to/mount/point
For example, if the partition you want to mount is /dev/sdb1
and you created a mount point directory named “mydisk” in your home directory, the command would be:
sudo mount /dev/sdb1 ~/mydisk
If the command succeeds, you should be able to access the contents of the mounted partition in the mount point directory you created. You can verify this by navigating to the directory using the cd
command and listing its contents with ls
.
Step 6: Unmount the partition
When you’re done accessing the data on the mounted partition, you can unmount it using the umount
command. Simply type the following command into the terminal, replacing /path/to/mount/point
with the path to the mount point directory you created earlier:
sudo umount /path/to/mount/point
Conclusion
In this guide, we’ve shown you how to mount a Linux partition on an external disk in Linux. By following these steps, you can access the data on your external disk and manipulate it as needed.