Ubuntu: Mount The Drive From Command Line

Ubuntu: Mount The Drive From Command Line

To mount a drive from the command line on an Ubuntu system, you will need to follow these steps:

  1. Determine the device name of the drive. Run the lsblk command to list the block devices on your system. Look for the device name of the drive you want to mount. It will be listed under the NAME column.

  2. Create a mount point for the drive. A mount point is a directory where the drive will be mounted. Create a directory for the mount point using the mkdir command. For example:

refer to‮:‬lautturi.com
mkdir /mnt/mydrive
  1. Mount the drive. Use the mount command to mount the drive on the mount point you created. For example:
mount /dev/sdb1 /mnt/mydrive

Replace /dev/sdb1 with the actual device name of your drive.

  1. Access the files on the drive. You can now access the files on the drive by navigating to the mount point you created. For example:
cd /mnt/mydrive
  1. Unmount the drive when you are finished. When you are finished accessing the files on the drive, you should unmount it to prevent data loss. Use the umount command to unmount the drive:
umount /mnt/mydrive

Keep in mind that you will need to have the appropriate permissions to use the mount and umount commands. Typically, only the root user or users with sudo privileges can mount and unmount drives.

Created Time:2017-10-30 14:27:28  Author:lautturi