
:max_bytes(150000):strip_icc()/020_install-ubuntu-linux-windows-10-steps-2202108-7aae2910c685414a945e1dc867dfbec1.jpg)
#UBUNTU DISK MAP CODE#
The code below is for mounting a device using a GUI. Press ‘y' to kill the process and do the same for the next prompt, then: $ sudo umount dev/sdXN

The output will show runing processes, example: /dev/sdXN: 8933 9628c Use the device is found by lsof(8) or fuser(1).)ĭo this to kill the busy processes and unmount the drive (substitute sdXN with the correct drive info: $ sudo fuser -kim /dev/sdXN (In some cases useful info about processes that If you are trying to unmount a drive ( or USB drive) and are seeing the error: $ sudo umount /media/yourdrive Be safe – unmount your drives before disconnecting them! ERRORS & SOLUTIONS This applies to all types of storage devices, including flash drives, flash cards, external hard drives, ipods and other media players, and even remote storage like Samba or NFS shares.įailure to unmount before disconnecting the device can result in loss of data and/or a corrupted file system.

#UBUNTU DISK MAP WINDOWS#
This is similar to “Safely Remove” in Windows in that the device won't unmount until data is finished being written to the device, or until other programs are finished using it. If you try the code below on an ntfs formatted drive, you will get the error: ntfs-3g-mount: bad mount point media/reddrive: No such file or directory The Importance of Unmountingīefore disconnecting devices, you must unmount them first. The last line above is for an ntfs formatted drive. $ sudo mount -t ntfs-3g /dev/sdXN /media/newdrive sdc2, sdb1, etc) and substitute this into ‘sdXN' below $ cd /media Now add this line to the end, changning the UUID for yours and /mnt/Disk should be changed to where you want to mount the disk: UUID=40e554eb-6421-4813-88ea-3882a3a7a153 /mnt/Disk auto nosuid,nodev,nofail,x-gvfs-show 0 0Ĭtrl+X, then ‘Y' to save and exit. Now open this file: $ sudo nano /etc/fstab Then we need the UUID of the disk to be mounted, find it with the code below replacing sdXX with the correct device id from the previous step: $ blkid /dev/sdXX Note the device id of the disk to be mounted, for example ‘sda1'. Or: $ sudo umount /media/external Automount a Drive Assuming /dev/sdb1 is mounted at /media/external, you can either unmount using the device or the mount point: $ sudo umount /dev/sdb1 When you are finished with the device, don't forget to unmount the drive before disconnecting it. $ sudo mkdir /media/externalįor devices formatted in FAT16 or FAT32: $ sudo mount /dev/sdb1 /media/externalįor devices formatted in ntfs: $ sudo mount -t ntfs-3g /dev/sdb1 /media/external 3. In the example below, the mount point name is “external”.
