Depending on the number of USB drives available on your Linux system the block device name may change. Referring to the USB drive using block device name from the /etc/fstab may not provide you with a best long term solution. For example the bellow command will mount USB driver with NTFS file system: /dev/sdc1 /media/usb-drive ntfs defaults 0 0 In order to mount your USB in Linux permanently after reboot add the following line into your /etc/fstab config file: /dev/sdc1 /media/usb-drive vfat defaults 0 0įor any other file system type simply set correct type. Use the device is found by lsof(8) or fuser(1).)Ĭlose your shell or navigate away from USB mount point and execute the following linux command to unmount your USB drive: # umount /media/usb-drive (In some cases useful info about processes that If all went well, we can access our USB data simply by navigating to our previously created mount point /media/usb-drive: # cd /media/usb-driveīefore we are able to unmount our USB partition we need to make sure that no process is using or accessing our mount point directory, otherwise we will receive an error message similar to the one below: umount: /media/usb-drive: target is busy Alternatively, double-check whether you have used a correct block device name in the above command. If no output has been produced by the above mount command your USB partition is not mounted. dev/sdc1 on /media/usb-drive type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=utf8,shortname=mixed,errors=remount-ro To check whether your USB drive has been mounted correctly execute mount command again without any arguments and use grep to search for USB block device name: # mount | grep sdc1 Use mkdir command to create a new mount point directory where you want to mount your USB device: # mkdir /media/usb-driveĪt this stage we are ready to mount our USB’s partition /dev/sdc1 into /media/usb-drive mount point: # mount /dev/sdc1 /media/usb-drive/ Mount point can be any new or existing directory within your host filesystem. For example in our case that will be /dev/sdc1 with FAT32 filesystem.īefore we are able to use mount command to mount the USB partition, we need to create a mount point. Once ready, take a note of the block device name of the partition you intent to mount. Look for your USB drive based on its size and filesystem. The above output will most likely list multiple disks attached to your system. I/O size (minimum/optimal): 512 bytes / 512 bytesĭevice Boot Start End Sectors Size Id Type Sector size (logical/physical): 512 bytes / 512 bytes Upon executing the above command you will get an output similar to the one below: Disk /dev/sdc: 7.4 GiB, 7948206080 bytes, 15523840 sectors Video Example on how to mount USB in Linuxįdisk command requires administrative privileges to access the required information, thus, from this reason, the commands needs to be executed as a root user or with sudo prefix. $ – requires given linux commands to be executed as a regular non-privileged user # – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command Privileged access to your Linux system as root or via the sudo command. Requirements, Conventions or Software Version Used How to mount USB drive in Linux Software Requirements and Conventions Used Software Requirements and Linux Command Line Conventions Category To gain more understating read the subsequent paragraphs. The video example below will illustrate the entire process of mounting USB drive on Linux system. Mounting USB drive is no different than mounting USB stick or even a regular SATA drive. If you are using desktop manager, you will most likely be able to use it to mount USB drive for you. This allows you to mount a USB drive of any file system, to some mount point on your system. In this tutorial, we explain how to mount USB drives in a Linux system using terminal and shell command line.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |