Linux Windows CentOS Web Server DNS PHP MySql

วันศุกร์ที่ 9 สิงหาคม พ.ศ. 2556

Sometimes devices don’t automount, in which case you should try to manually mount it. First, you must know what device we are dealing with and what filesystem it is formatted with. Most flash drives are FAT16 or FAT32 and most external hard disks are NTFS.
sudo fdisk -l
Find your device in the list, it is probably something like /dev/sdb1.

Create the Mount Point

Now we need to create a mount point for the device, let’s say we want to call it “external”. You can call it whatever you want, just please don’t use spaces in the name or it gets a little more complicated – use an underscore to separate words (like “my_external”). Create the mount point:
sudo mkdir /media/external

Mount the Drive

We can now mount the drive. Let’s say the device is /dev/sdb1, the filesystem is FAT16 or FAT32 (like it is for most USB flash drives), and we want to mount it at /media/external (having already created the mount point):
sudo mount -t vfat /dev/sdb1 /media/external -o uid=1000,gid=1000,utf8,dmask=027,fmask=137
The options following the “-o” allow your user to have ownership of the drive, and the masks allow for extra security for file system permissions. If you don’t use those extra options you may not be able to read and write the drive with your regular username.Otherwise if the device is formatted with NTFS, run:
sudo mount -t ntfs-3g /dev/sdb1 /media/external
NOTE: You must have the ntfs-3g driver installed.

Unmounting the Drive

When you are finished with the device, don’t forget to unmount the drive before disconnecting it. Assuming /dev/sdb1 mounted at /media/external, you can either unmount using the device or the mount point:
sudo umount /dev/sdb1
or:
sudo umount /media/external
You cannot unmount from the desktop by right clicking the icon if the drive was manually mounted.

0 ความคิดเห็น:

แสดงความคิดเห็น