Mount external USB harddisk at boot

Hello,

I want to mount a USB disk at startup.
My directory “Documents” in my home folder is soft linked to the directory “Documents” on the external hard disk, so that I can use my documents on several computers.

I made a directory in mnt “DOCU” and an entry in fstab “LABEL=DOCU /mnt/DOCU ntfs rw,user,exec,suid” (and yes all my entries in fstab are with LABEL=); set the permissions to 666.

The filesystem of the external hd is ntfs. I use openSUDE 13.1 , Kubuntu 13.10, Windows XP, and Windows 8.1

I have some programs which only work in MSWindows, programs to program PLC’s (Siemens S7-1200, Siemens Logo! ans Schneider Zelio)

Thanks for a solution!

And to what problem?

The only thing I see is that you’re using “ntfs” as filesystem type, that’s the read-only kernel filesystem.
Better use “ntfs-3g” instead.

And you seem to be missing “0 0” at the end of that fstab line, but maybe you just didn’t paste that here.

On 2013-11-18 21:56, cduf wrote:
>
> Hello,
>
> I want to mount a USB disk at startup.
> My directory “Documents” in my home folder is soft linked to the
> directory “Documents” on the external hard disk, so that I can use my
> documents on several computers.
>
> I made a directory in mnt “DOCU” and an entry in fstab “LABEL=DOCU
> /mnt/DOCU ntfs rw,user,exec,suid” (and yes all my entries in fstab
> are with LABEL=); set the permissions to 666.

Well, that how I would do it. Is it not working, do you get an error?
Symptoms?

Can you post your fstab file? Do it inside a code tags section - use the
‘#’ button in the editor.


Cheers / Saludos,

Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)

My normal suggestion for mounting hard drives is to NOT use any preexisting folder names unless it is in my /home/username area. For mounts outside of /home, I use such folder names from root as /Windows, /Software, /Backup and /DataSave. I don’t think using 666 Permissions for this folder is a problem, but I hate using the number 666 and normally just go with 777 for my folder mounts. I normally use the disk/by-id to name the hard drive which you can determine by looking at it in the YaST Partitioner. Other things when mounted in the fstab include options of nofail & defaults. Here is an example of my fstab mount.

/dev/disk/by-id/usb-ST1000DM_003-9YN162_1D0F65888888-0:0-part1 /Backup          ntfs-3g    defaults,nofail      0 0

For easy editing of system files like the fstab file, please look at my blog post here: SYSEdit - System File Editor - Version 1.50 - Blogs - openSUSE Forums

Thank You,

You need

  • “defaults” for ntfs-3g
  • a mountpoint like /data/DOCU and adjusted symlink, rather than having to change the permissions of a system folder (/mnt) or have something mounted in that folder permanently.

Changing permissions doesn’t work on NTFS, plus “666” for folders means you can’t enter them: 666 = rw-rw-rw-. Try with a test folder. “666” is wrong anyway, the last “6” is “rest of the world”, you don’t want that.

Normally, if I share a local mount with Samba, I do use permissions of 777 and defaults for the ntfs drive partition. This does allow all users to have read/write access locally and remotely to this drive. If you want tighter control, then it is assumed you know how to do that. On a local area network, I don’t have a problem with this setup.

Thank You,

On 2013-11-18 22:36, Knurpht wrote:

> to change the permissions of a system folder (/mnt) or have something
> mounted in that folder permanently.

No, no, “/mnt” is precisely intended for external mounts like this one.
That is, “/mnt/something”, not “/mnt”


Cheers / Saludos,

Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)

On 2013-11-18 22:36, jdmcdaniel3 wrote:

> /Software, /Backup and /DataSave. I don’t think using 666 Permissions
> for this folder is a problem, but I hate using the number 666 and
> normally just go with 777 for my folder mounts. I normally use the

You can not set permissions that way on an ntfs partition, they do not
work. You have to use instead “fmask=…,dmask=…” as mount options.

Look:


cer@minas-tirith:/windows/C/Users/Cer> touch p
cer@minas-tirith:/windows/C/Users/Cer> l p
-rw-rw---- 1 root users 0 Nov 18 23:09 p
cer@minas-tirith:/windows/C/Users/Cer> chmod o+r p
chmod: changing permissions of `p': Operation not permitted
cer@minas-tirith:/windows/C/Users/Cer> chmod u-r p
chmod: changing permissions of `p': Operation not permitted
cer@minas-tirith:/windows/C/Users/Cer> su
Password:
minas-tirith:/windows/C/Users/Cer # chmod o+r p
minas-tirith:/windows/C/Users/Cer # l p
-rw-rw---- 1 root users 0 Nov 18 23:09 p
minas-tirith:/windows/C/Users/Cer #

The permission can not be set even as root.


Cheers / Saludos,

Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)

I am talking about the folder name created in the linux root / drive which is NOT located on the NTFS partition. I do not mess with permissions on the NTFS partition. This all has to do with giving full r/w access to the partition to all users.

Thank You,

On 2013-11-18 23:46, jdmcdaniel3 wrote:

> I am talking about the folder name created in the linux root / drive
> which is NOT located on the NTFS partition. I do not mess with
> permissions on the NTFS partition. This all has to do with giving full
> r/w access to the partition to all users.

I see.
But you need adjusting both, the folder and the contents, to allow
permissions. The “defaults” usually work.


Cheers / Saludos,

Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)

The share folder permissions of 777 are recommended by many and does not impair all users of having access to it.