2

I've 4 Ext4 partitions on 2TB HDD mounted at /mnt. I wanted to mount them at /media.

my questions are

  • How can I do that?
  • After mounting at /media will they be visible in the sidebar in nautilus? (now they are not)
  • what are the advantages or disadvantages of doing it for partitions that mostly contains Video/Music/images (i.e, Media)?

output of cat /etc/fstab

$ cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name 
devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda5 during installation
UUID=6de91b2b-f519-445c-9b59-5b3f0ac727c5 /               ext4    
errors=remount-ro 0       1
# /home was on /dev/sda6 during installation
UUID=bd7673b1-589a-4ab6-842c-0324d563c838 /home           ext4    
defaults        0       2
# swap was on /dev/sda1 during installation
UUID=d1749176-6c41-4961-a6bd-0c6a56968970 none            swap    sw              
0       0
/dev/disk/by-uuid/54c9765b-af6d-4a62-905f-09b56e280178 /mnt/Stuff auto 
nosuid,nodev,nofail,x-gvfs-show 0 0
/dev/disk/by-uuid/b2d7f1a7-f3e6-4ca5-9925-d8225c897e4d /mnt/Movies 
auto nosuid,nodev,nofail,x-gvfs-show 0 0
/dev/disk/by-uuid/c2104e2a-cc8e-4b7b-9bba-a05d316472b4 /mnt/Hollywood 
auto nosuid,nodev,nofail,x-gvfs-show 0 0
/dev/disk/by-uuid/707694b6-97b8-4374-9283-c98192591486 /mnt/Series 
auto nosuid,nodev,nofail,x-gvfs-show 0 0

output of lsblk

NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sdb      8:16   0   1.8T  0 disk 
├─sdb4   8:20   0   713G  0 part /mnt/Series
├─sdb2   8:18   0   220G  0 part /mnt/Movies
├─sdb3   8:19   0   710G  0 part /mnt/Hollywood
└─sdb1   8:17   0   220G  0 part /mnt/Stuff
sda      8:0    0 111.8G  0 disk 
├─sda2   8:2    0     1K  0 part 
├─sda5   8:5    0  14.3G  0 part /
├─sda3   8:3    0  44.9G  0 part 
├─sda1   8:1    0   7.6G  0 part [SWAP]
└─sda6   8:6    0  44.9G  0 part /home

enter image description here

  • @Zanna can i do that from the disks application? – Sumeet Deshmukh Apr 6 '17 at 6:16
  • What do you mean you have a 2 TB hard drive mounted at /mnt? I don't think you can mount a hard drive. You can only mount partitions. – misha Apr 6 '17 at 6:18
  • @misha ive 4 ext4 partitions that are made on 2TB HDD which are mounted at /mnt – Sumeet Deshmukh Apr 6 '17 at 6:22
  • 1
    Regarding whether you can do it using GNOME disks, yes you can use it to edit fstab for you, see for example How to mount a new drive on startup. And yes you should edit your question to include the output of cat /etc/fstab and lsblk when the partitions are mounted, if you still need help – Zanna Apr 6 '17 at 6:33
5

The following command is used to unmount whatever is currently mounted at a particular directory (-v turns on verbose output so that you're informed by the command as to what's going on during the mounting/unmounting process):

sudo umount -v [DIRECTORY]

In your case, you're going to have to run these four commands:

sudo umount -v /mnt/Stuff
sudo umount -v /mnt/Movies
sudo umount -v /mnt/Hollywood
sudo umount -v /mnt/Series

Here's how you remount your partitions (and yes, your file manager will have no problems seeing and opening them up) (don't forget to create the directories themselves first: sudo mkdir /media/Stuff etc.):

sudo mount -t auto -o rw /dev/sdb1 /media/Stuff -v
sudo mount -t auto -o rw /dev/sdb2 /media/Movies -v
sudo mount -t auto -o rw /dev/sdb3 /media/Hollywood -v
sudo mount -t auto -o rw /dev/sdb4 /media/Series -v

Now, open the /etc/fstab file like this:

sudo nano -w /etc/fstab

And change all occurrences of mnt in there to media:

/dev/disk/by-uuid/54c9765b-af6d-4a62-905f-09b56e280178 /media/Stuff auto 
nosuid,nodev,nofail,x-gvfs-show 0 0
/dev/disk/by-uuid/b2d7f1a7-f3e6-4ca5-9925-d8225c897e4d /media/Movies 
auto nosuid,nodev,nofail,x-gvfs-show 0 0
/dev/disk/by-uuid/c2104e2a-cc8e-4b7b-9bba-a05d316472b4 /media/Hollywood
auto nosuid,nodev,nofail,x-gvfs-show 0 0
/dev/disk/by-uuid/707694b6-97b8-4374-9283-c98192591486 /media/Series 
auto nosuid,nodev,nofail,x-gvfs-show 0 0

As for your last question, there are neither real advantages nor disadvantages to moving your partitions to the media directory except that the mnt directory traditionally has been used primarily for temporary mounting. So, it might indeed be logical to have your stuff mounted in the media directory, though the media directory is typically used for removable media such as USB sticks, external hard drives, CD-ROMs et cetera. Other than that, it makes no difference whatsoever where your things are mounted in the file system.

  • but they will be visible in left sidebar of Nautilus, right? that is still an advantage? – Sumeet Deshmukh Apr 6 '17 at 6:43
  • mount: mount point /media/Stuff does not exist do i need to create that folder in media? – Sumeet Deshmukh Apr 6 '17 at 6:53
  • Yes, you do. Did everything work as planned? – misha Apr 6 '17 at 7:06
  • yes, it did, now they are all mounted at media i can access them, they just didn't appear in the left sidebar of nautilus, ultimately i wanted to achieve this by doing this whole thing askubuntu.com/questions/900671/… – Sumeet Deshmukh Apr 6 '17 at 7:10
  • 1
    Well, just bookmark them by dragging them over to the side panel. – misha Apr 6 '17 at 7:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.