mount and unmont a USB drive

mount and unmont a USB drive on Ubuntu / Linux

mount and unmont a USB drive on Ubuntu / Linux

Step 1: Plug in the USB drive to usb port of yor computer system.

Step 2: Run the following command in your Terminal in order to check the available storage devices on your system and the file system they are using:

Output

mount and unmont a USB drive

It will display multiple disks connected to your system. Find out your usb drive by looking size of your pendrive. Take a note of your pendrive. For example here it will be /dev/sdb1 with FAT32 filesystem.

Step 3: Create mount point

Now let’s make it available to all users:

 

Here we all done

Accessing USB Data

Now we can access our Pendrive data by navigating to  /media/usbpen

now we are in pendrive

Permanent Mount

For permanently mounting your Pendrive or USB drive  after reboot add the following line into your /etc/fstab config file

Now add the following entry at the end of that file:

To make sure the drive mounted successfully issue the command:

it will show you pendrive mount point

NOTE: for Permanent Mount of pendrive i am using bash script with run on startup of computer system

Make a sh file and save it ( i am saving file name as mountPendrive in opt folder ot computer system )

Add below line then save and exit ( Esc :wq! )

 

 

Then add this file at crontab on rebbot of system ( whenever system reboot ot start it will mont your pen drive)

now add below line in crontab and save and exit crontab

@reboot /opt/mountPendrive.sh

Unmount Pendrive

for nmounting pendrive first we have come out from pendrive may be in /tmp then run unmont command

And also:

or again mounting

 

Leave a Reply

Your email address will not be published. Required fields are marked *