Jump to content



Photo

My Linux Based Questions

linux questions ubuntu help

  • Please log in to reply
72 replies to this topic

#31 +Majesticmerc

Majesticmerc

    Resident Idealist

  • Tech Issues Solved: 8
  • Joined: 24-August 05
  • Location: United Kingdom
  • OS: Arch Linux / Win 7
  • Phone: HTC One X

Posted 09 February 2013 - 21:02

I think they should be automatically mounted these days. Either way, if you have to manually mount an internal drive on boot, you can add it to your /etc/fstab file (Ubuntu info: 1, 2).

It goes without saying that you should be careful when editing your fstab file, as you can screw up your system with a bad fstab, although it's nothing that can't be recovered as long as you back up your original fstab.


#32 OP +bman

bman

    Neowinian Senior

  • Tech Issues Solved: 1
  • Joined: 03-January 03
  • Location: Ottawa, Ontario
  • OS: Windows 8.1 & Android

Posted 09 February 2013 - 21:54

I believe fstab is the way I tried last time. So I'd rather avoid it this time if I could?..

*is this all I have to do?

up a terminal -

  • sudo blkid - note the UUID of the partition you want to mount.

  • sudo nano /etc/fstab - copy the following line to the end of the file - UUID=xxxxyyyy /path/to/partition (add ntfs-3g if it is an NTFS partition) uid=1000,gid=1000,umask=0022,sync,auto,nosuid,rw,nouser 0 0

  • Save the file and restart computer to check.

If so, /path/to/partition would be /media/Shows if that is my drive named Shows? Or is it looking for a full path? And that code doesn't change anything else about the drive right? Just that it now auto mounts on start up...

So for my Shows drive it would be..

UUID=0eaf61f0-f491-465b-af62-a59b350118c3 /media/Shows uid=1000,gid=1000,umask=0022,sync,auto,nosuid,rw,nouser 0

Right..?

#33 +Majesticmerc

Majesticmerc

    Resident Idealist

  • Tech Issues Solved: 8
  • Joined: 24-August 05
  • Location: United Kingdom
  • OS: Arch Linux / Win 7
  • Phone: HTC One X

Posted 09 February 2013 - 22:09

I think so, although I wouldn't call myself the king of fstab. You'd obviously need to create the directory /media/Shows in advance (as well as for the other drives). You should (IIRC) be able to simply check your changes by adding the line to /etc/fstab and then calling "sudo mount -a" and seeing if it mounts. If it doesn't adjust as necessary until it does.

#34 OP +bman

bman

    Neowinian Senior

  • Tech Issues Solved: 1
  • Joined: 03-January 03
  • Location: Ottawa, Ontario
  • OS: Windows 8.1 & Android

Posted 09 February 2013 - 22:12

You just confused me.

My drives are mounted, because I clicked on it and mounted it.

What do you mean create the directory before hand....that is the directory of the drive??

#35 ajcdotme

ajcdotme

    General Nitwit

  • Joined: 17-November 11
  • Location: Ligonier, PA
  • OS: OSX, Centos 6, Ubuntu, SmartOS, Windows Server
  • Phone: Nokia Lumia 822

Posted 09 February 2013 - 23:06

You just confused me.

My drives are mounted, because I clicked on it and mounted it.

What do you mean create the directory before hand....that is the directory of the drive??


Linux file systems are fairly object based in that a folder on one drive (or appearing there as viewed by the filesystem) can actually be a symlink to an entirely different folder. I generally like to mount a drive as an object, then create a base folder structure on it to link to... if this fits what you want to do, you've got a couple part process.

#1 for the sake of flexibility, I'd mount the drive under /mnt/drivename (pick one) instead of mounting directly to your filesystem.

#2, as Majesticmerc said, use your mounting in fstab so that if you break a mount point, you don't get locked out on reboot. unmount your drive, create the uuid entry in fstab (your line above looks correct to me, change out /media/Shows portion for /mnt/drivename from above.) then call sudo mount -a which should run through your fstab file and attempt mounts. if the feedback it gives you is confusing, just enter "show mount" in terminal and you should see your drive listed.

#3 sudo mkdir /mnt/drivename/Shows (actual data storage location)

#4 cd /media (puts you where you want to link)

#5 ln -s /mnt/drivename/Shows Shows (creates a symlink from this directory to the mounted drive, explicitly named)


I know this is more steps than are actually needed, but gives you the flexibility of moving other directories to the drive for additional storage if needed. for example, /mnt/drivename/Movies, and allowing you to keep the files separate. Personal preference, but I tend to try to error on the side of future flexibility.

#36 OP +bman

bman

    Neowinian Senior

  • Tech Issues Solved: 1
  • Joined: 03-January 03
  • Location: Ottawa, Ontario
  • OS: Windows 8.1 & Android

Posted 10 February 2013 - 02:09

I honestly didn't understand any of that.

All I know is my drives are under /media and that's it. I don't really want to fiddle around. I guess I am stuck with manual mounting.

The problem is I have programs that have permissions to those locations, the drives as is, if I change something everything is messed up.

#37 Haggis

Haggis

    Neowinian Senior

  • Tech Issues Solved: 12
  • Joined: 13-June 07
  • Location: Near Stirling, Scotland
  • OS: Debian 7
  • Phone: Samsung Galaxy S3 LTE (i9305)

Posted 10 February 2013 - 12:18

is it an external drive?

so say you want to mount it to /home/shows

i would try adding


UUID=xxxxyyyy /home/shows ext4 defaults 0 0

change the ext4 if its a different type


for example this is my fstab

UUID=55863616-9993-484a-8112-644e48540019 /                       ext4    discard,noatime,nodiratime,defaults	    1 1
UUID=a413c0d4-5583-42f4-88b1-413e950ee0bd /boot                 ext4    discard,noatime,nodiratime,defaults	    1 2
UUID=bfbcfd6d-2d47-46f0-ba15-cba0bc5ccfbe /home				   ext4    discard,noatime,nodiratime,defaults	    1 2
UUID=1ec148df-8757-4980-a242-f95c40068194 /swap                 ext4    discard,noatime,nodiratime,defaults	    1 2
none /tmp tmpfs defaults 0 0
/dev/sda1 /home/haggis/Storage ext4 defaults 0 0


#38 +Majesticmerc

Majesticmerc

    Resident Idealist

  • Tech Issues Solved: 8
  • Joined: 24-August 05
  • Location: United Kingdom
  • OS: Arch Linux / Win 7
  • Phone: HTC One X

Posted 10 February 2013 - 12:35

You just confused me.

My drives are mounted, because I clicked on it and mounted it.

What do you mean create the directory before hand....that is the directory of the drive??


Drives must be mounted in a specific directory, and that directory must exist beforehand. Now if you're mounting the drive through your file browser (e.g. Nautilus, Dolphin, Thunar, PCManFM, etc), this directory will be created automatically, and deleted when you unmount the drive. If you want to mount the drive manually at boot-time, you'll have to create these directories inside /media using mkdir as a super user (i.e. root) while the drives are already unmounted.

Next, create the fstab lines as discussed, and use the "mount -a" command (or mount /media/Shows) as super user to test your fstab. Once everything is working your disks should be mounted on boot.

I'd recommend taking a look at this article on the Arch Linux wiki for a bit more insight on working with fstab: https://wiki.archlin...ndex.php/Fstab. It's not Arch specific, and very informative IMO.

#39 Farchord

Farchord

    Life is but a sum of your achievements

  • Joined: 06-November 01
  • Location: Shawinigan, Quebec, Canada
  • Phone: iPhone 5

Posted 10 February 2013 - 13:27

I honestly didn't understand any of that.

All I know is my drives are under /media and that's it. I don't really want to fiddle around. I guess I am stuck with manual mounting.

The problem is I have programs that have permissions to those locations, the drives as is, if I change something everything is messed up.


Heh I'll add a little note to try to relieve your confusion.

In linux, EVERYTHING in your computer is a device. Everything is in /dev. But it's not as simple as opening something up in /dev, it has to be 'mounted', or 'interpreted' with the proper driver.

Now, in Ubuntu, most drives are automatically mounted once you click them in the file manager (And maybe enter your administrator password).

So like the guys are trying to explain before me, if you want to force mount a drive on boot, you need to first make a folder anywhere (Although it's probably better for organisation-sake if you just create one in /media, but that's up to you) and then add the fstab line they mentionned earlier.

To create a folder in anywhere but /home, do sudo mkdir /path/directory (For example, sudo mkdir /media/musicdrive).

#40 OP +bman

bman

    Neowinian Senior

  • Tech Issues Solved: 1
  • Joined: 03-January 03
  • Location: Ottawa, Ontario
  • OS: Windows 8.1 & Android

Posted 10 February 2013 - 14:28

So right now I manually mount my drive from within PCManFM. Which creates

/media/Media
/media/Shows
/media/Movies
/media/Films

If I want that to happen automatically on start up I would want to unmount the drives and do this.

sudo mkdir /media/Media
sudo mkdir /media/Shows
sudo mkdir /media/Movies
sudo mkdir /media/Films

Then add this line for each at the end of fstab.


UUID=0eaf61f0-f491-465b-af62-a59b350118c3 /media/Shows uid=1000,gid=1000,umask=0022,sync,auto,nosuid,rw,nouser 0

Then do mount -a to test the new mount points before rebooting? (And no these are all internal drives)

Correct?

#41 +Majesticmerc

Majesticmerc

    Resident Idealist

  • Tech Issues Solved: 8
  • Joined: 24-August 05
  • Location: United Kingdom
  • OS: Arch Linux / Win 7
  • Phone: HTC One X

Posted 10 February 2013 - 15:00

That is correct, although obviously the uuids will be different. :)

#42 OP +bman

bman

    Neowinian Senior

  • Tech Issues Solved: 1
  • Joined: 03-January 03
  • Location: Ottawa, Ontario
  • OS: Windows 8.1 & Android

Posted 10 February 2013 - 15:03

If something on my system, a program, uses those drives, accesses /media/Shows etc all the time.

Once this is done, will that program still be able to do that, or will I need to re-add the directory to the application?

I assume it's going to be the same, but want to make sure.

#43 srbeen

srbeen

    Neowinian

  • Joined: 30-November 11

Posted 10 February 2013 - 15:11

I found a ubuntu bug where if you try to install ubuntu over an already installed ubuntu, theres absolutely no problem seeing the wifi password in the clear provided an account has wifi setup on the machine, without entering any user account infos or anything. It pops up during the install for downloading updates... Discovered by accident due to bad installed graphic drivers.

#44 OP +bman

bman

    Neowinian Senior

  • Tech Issues Solved: 1
  • Joined: 03-January 03
  • Location: Ottawa, Ontario
  • OS: Windows 8.1 & Android

Posted 10 February 2013 - 15:14

I just followed the instructions, when I do sudo mount -a I get the following


mount: unknown filesystem type 'nouser'
mount: unknown filesystem type 'nouser'
mount: unknown filesystem type 'nouser'
mount: unknown filesystem type 'nouser'

Do I need to put ext4 somewhere in those lines?

Like I have


UUID=12498dda-899a-4e48-9d6e-a5372340f3dd /media/Movies uid=1000,gid=1000,umask=0022,sync,auto,nosuid,rw,nouser 0

Should I put


UUID=12498dda-899a-4e48-9d6e-a5372340f3dd /media/Movies ext4 uid=1000,gid=1000,umask=0022,sync,auto,nosuid,rw,nouser 0

#45 +Majesticmerc

Majesticmerc

    Resident Idealist

  • Tech Issues Solved: 8
  • Joined: 24-August 05
  • Location: United Kingdom
  • OS: Arch Linux / Win 7
  • Phone: HTC One X

Posted 10 February 2013 - 15:23

I just followed the instructions, when I do sudo mount -a I get the following


mount: unknown filesystem type 'nouser'
mount: unknown filesystem type 'nouser'
mount: unknown filesystem type 'nouser'
mount: unknown filesystem type 'nouser'

Do I need to put ext4 somewhere in those lines?

Like I have


UUID=12498dda-899a-4e48-9d6e-a5372340f3dd /media/Movies uid=1000,gid=1000,umask=0022,sync,auto,nosuid,rw,nouser 0

Should I put


UUID=12498dda-899a-4e48-9d6e-a5372340f3dd /media/Movies ext4 uid=1000,gid=1000,umask=0022,sync,auto,nosuid,rw,nouser 0


Sorry, I missed that in your fstab line. Yes, you'll need to add your file system with the line (Linux doesn't/can't autodetect in most cases). Using your example above, you'll need a line like this:

UUID=0eaf61f0-f491-465b-af62-a59b350118c3   /media/Shows	ext4	uid=1000,gid=1000,umask=0022,sync,auto,nosuid,rw,nouser	 0   0
                                                                 ^                                                                   ^
                                                                 |                                                                   |
                                                          File system here                                                    Pass value here

This assumes that your file system is ext4. You'll need to change this depending on the file system (e.g. ntfs-3g, ext3, etc)

Once your drive is automounting, you shouldn't need to do anything to your application, but get back to us if you get stuck of course :)

(Edited: Alignment)