How to Auto Mount HDDs?

openSUSE 12.1 KDE

Can’t get my hard drives to auto mount. Every time I open Dolphin, click on the drive, I get the ‘authentication’ box pop up.‘Remember authorization’ is ticked but on next boot I have to do it again. Also doesn’t help with programs that have paths going to HHDs.

So how can I get it to stick?

Show use output

cat /etc/fstab

Are these “drives” Windows? Or some other format?

Still new to linux.

Don’t know how to use Show use output cat /etc/fstab :frowning: will keep trying though.

The drive with windows is OK.

I have two other drives for storage. File system is ntfs. These are the two that won’t auto mount.

In KDE press the keys Alt and F2 (Alt-F2) and in the box at the top middle of the screen enter: konsole and then press the enter key. At the terminal prompt, type the command:

cat /etc/fstab

On My system, I get the output:

/dev/disk/by-id/ata-Corsair_Performance3_SSD_1117810101000341020B-part2         swap            swap    defaults,noatime,discard        0       0
/dev/disk/by-id/ata-Corsair_Performance3_SSD_1117810101000341020B-part4         /               ext4    acl,user_xattr,noatime,discard  0       1
/dev/disk/by-id/ata-Corsair_Performance3_SSD_111381000100034100BF-part1         /home           ext4    acl,user_xattr,noatime,discard  0       2
/dev/disk/by-id/ata-WDC_WD3000GLFS-01F8U0_WD-WXL408720641-part2                 /Windows        ntfs-3g defaults                        0       0
/dev/disk/by-id/ata-MAXTOR_STM31000340AS_5QJ0E8KF-part1                         /Multimedia     ntfs-3g defaults                        0       0
/dev/disk/by-id/ata-ST31000528AS_9VP1AEZJ-part1                                 /Software       ntfs-3g defaults                        0       0
/dev/disk/by-id/ata-Hitachi_HDS5C3020ALA632_ML0220F30MGP7D-part1                /DataSafe       ext4    defaults                        1       2
/dev/disk/by-id/usb-Hitachi_Hitachi_HDS72303_03100110711000004414-0:0-part1     /BACKUP         ntfs-3g defaults                        0       0
proc    /proc                   proc    defaults        0       0
sysfs   /sys                    sysfs   noauto          0       0
usbfs   /proc/bus/usb           usbfs   noauto          0       0
devpts  /dev/pts                devpts  mode=0620,gid=5 0       0
debugfs /sys/kernel/debug       debugfs noauto          0       0

This is the contents of the configuration file called fstab which is located in the /etc folder of your Linux hard drive. We would be looking for a reference to your hard drive. I used my mouse to highlight the text in the terminal screen and I then did a paste inside of a forum message. I switched to the advance message editor and after doing the paste, I selected just the pasted text in my forum message and pressed the Code # option which will enclose your fstab file in a code block as mine is shown above. My fstab file will not be the same as yours. It is very likely we will need to instruct you on how to add your external (or internal) hard drive to your fstab file for auto-mounting if the drive is always connected when you startup openSUSE.

Thank You,

Got to get my eyes checked. I missed the space between cat & /. :shame:

/dev/disk/by-id/ata-Corsair_Force_3_SSD_11366500000008951218-part5 swap                 swap       defaults              0 0
/dev/disk/by-id/ata-Corsair_Force_3_SSD_11366500000008951218-part6 /                    ext4       acl,user_xattr        1 1
/dev/disk/by-id/ata-Corsair_Force_3_SSD_11366500000008951218-part7 /home                ext4       acl,user_xattr        1 2
/dev/disk/by-id/ata-Corsair_Force_3_SSD_11376502000008950453-part2 /windows/C           ntfs-3g    users,gid=users,fmask=133,dmask=022,locale=en_US.UTF-8 0 0
proc                 /proc                proc       defaults              0 0
sysfs                /sys                 sysfs      noauto                0 0
debugfs              /sys/kernel/debug    debugfs    noauto                0 0
usbfs                /proc/bus/usb        usbfs      noauto                0 0
devpts               /dev/pts             devpts     mode=0620,gid=5       0 0

The two drives that won’t mount are internal. Western Digital Raptors.

So I think you need to run the Partitioner to see if the can be seen as they ARE NOT included in your fstab file. Also, I suggest you make the one change I show above to your fstab file and restart. I changed the NTFS partition to use the single option to defaults. Do an Alt-F2 and:

kdesu kwrite /etc/fstab

and make only the one change I show, replacing the long sting of options to just one. You must restart for this to work. To run the partitioner, you will run YaST / System / Partitioner and on the lefgt, tell us if the WD hard drive is being shown?

Thank You,

Yes both are showing up. One is sdc, the other sdd.

Ok you need to use the partitioner to mount the partitions on those drives which simply adds them to the /etc/fstab file. You will need to provide a mount point for each partition on each of the drives. Typically this would be something like /windows/d /windows/e etc this is done when setting it up in the partitioning software in Yast. The mount point can be anywhere in the current directory tree but avoid using current assigned names. Like crossing the streams, this can be very bad depending on which directory branch you overload.

So, using the Partitioner, you can add a permanent mount point to your fstab file. In Partitioner, on the left is the** System View** Window, open up Hard Disks and select sdc on the left which should show all partitions on sda on the Partitions tab on the right. Right click on sdc1 (or which ever partition you want to mount) and select Edit. Now, in the Mounting Partitions Box select the Mount partition bullet and enter a Mount Point for this partition to show up in your unified Linux file system. For instance, you may have found your Windows Partition is mounted as /windows/C. You can enter any valid folder name you wish to use. I have used these names before, /Software, /DataSafe, /Multimedia and you can even add to the /windows with a /windows/D for instance. The Do Not Format Partition is the default which you do not touch. Just press the Finish button on the bottom right when done. Now, do the same thing for sdd, but any folder name you use, must be different for the second hard drive. When completely done, press the Finish button in the bottom right and the Partitioner will create the two new folders and add these entries to your fstab file. If either partition is NTFS, I would also change its options to just read defaults and reboot for it to take effect. The Partitioner will immediately mount these partitions for you if not mounted and it does not require a reboot. Just if you change the fstab file.

Thank You,

gogalthorp, jdmcdaniel3, you guys are champions. All setup & behaving. Could not have done it without you. :slight_smile:

We were happy to help and if I have not said so before (I have a short memory) welcome to the openSUSE forum! Now we do extract one request. Since we helped you, can you find someone else here in need of help and try to help them as well? First, consider this is how you learn openSUSE. Second, only look at something for which you have interest in yourself. But, helping others always helps you and don’t forget it. Did I welcome you to the openSUSE forums … lol!

Thank You,

Can’t remember but thanks for the welcome. My memory is also like a sieve. :’(

I’ll certainly be hanging around & helping out where I can. Wealth of information here. openSUSE for me is slowly coming together. :slight_smile:

Seems solving one issue created another. I have photos on one of the drives that cannot be edited. I could edit them before. How do I get permission to write to the disk?

I’m using digikam.

If this is a NTFS partition, created by Windows, did you change the options to just read defaults if your fstab file as I suggested in a previous message?

Thank You,

Yes. Made the change to ‘defaults’. Tried changing it back to what it was. Still no go. In the process no of putting it back to ‘defaults’.

Just noticed when making the changes this:

/dev/disk/by-id/ata-WDC_WD1500HLFS-01G6U1_WD-WXC0CA9K9330-part1 /windows/D           ntfs-3g    users,gid=users,fmask=133,dmask=022,locale=en_US.UTF-8 0 0
/dev/disk/by-id/ata-WDC_WD1500HLFS-01G6U3_WD-WXC1C1053774-part1 /windows/E           ntfs-3g    users,gid=users,fmask=133,dmask=022,locale=en_US.UTF-8 0 0

Do I need to make both of those as defaults as well?

That did it. Make both ‘defaults’ & now I back to editing photos. Have to check things like that in the future.

If you have never edited the fstab file then telling someone to change the very long string of default settings to just say defaults does not make sense. But, this issue is there because you are using a Windows created partition with normal Linux partition settings. One could modify that long list and perhaps make it work, but using defaults is just easier and really, if you want to enforce Linux user rights, you need to use a native Linux partition like EXT4.

/dev/disk/by-id/ata-WDC_WD1500HLFS-01G6U1_WD-WXC0CA9K9330-part1 /windows/D           ntfs-3g    defaults 0 0
/dev/disk/by-id/ata-WDC_WD1500HLFS-01G6U3_WD-WXC1C1053774-part1 /windows/E           ntfs-3g    defaults 0 0

Thank You,

On 2011-12-30 15:16, jdmcdaniel3 wrote:

> If you have never edited the fstab file then telling someone to change
> the very long string of default settings to just say defaults does not
> make sense. But, this issue is there because you are using a Windows
> created partition with normal Linux partition settings. One could
> modify that long list and perhaps make it work, but using defaults is
> just easier and really,

It is indeed possible to edit the line. I change this:
“fmask=0117,dmask=0007” and it works. I don’t have to change the other
values to defaults, they are there for a reason.

Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

It seems for every expert out there, you can find a different recommendation for mounting NTFS partitions in your fstab file. Using just defaults produces the following options on my computer. The line in my fstab file that says:

/dev/disk/by-id/ata-WDC_WD3000GLFS-01F8U0_WD-WXL408720641-part2            /Windows    ntfs-3g    defaults            0    0

Turns into this (To see this, open up terminal and type just the command mount, with no options):

/dev/sdc2 on /Windows type fuseblk (rw,relatime,user_id=0,group_id=0,allow_other,blksize=4096) 

Using only the defaults option requires the least amount of effort and understanding to be able to write to NTFS partitions as a regular user and is all that is required on a single user system. For other expert recommendations, look to this article:

HowTo Mount NTFS Filesystem Partition Read Write Access in openSUSE

I found some interesting data on it in a Wiki as well:

ntfs-3g Default settings

Using the default settings will mount the NTFS partition(s) at boot. With this method, if the parent folder that it is mounted upon has the proper user or group permissions, then that user or group will be able to read and write on that partition(s).

Put this in /etc/fstab:

# <file system>   <dir>        <type>    <options>      <dump>  <pass>
/dev/<NTFS-part>  /mnt/windows  ntfs-3g   defaults        0       0

Allowing Group/User

You can also tell /etc/fstab (the NTFS-3G driver) other options like those who are allowed to access (read) the partition. For example, for you to allow people in the users group to have access:

/dev/<NTFS-part>  /mnt/windows  ntfs-3g   gid=users,umask=0022    0       0

By default, the ntfs-3g driver enable write support for root only. To enable user writing, use the dmask parameter to enable user writing:

/dev/<NTFS-part>  /mnt/windows  ntfs-3g   gid=users,fmask=113,dmask=002    0       0

If you are running on a single user machine, you may like to own the file system yourself:

/dev/<NTFS-part>  /mnt/windows  ntfs-3g   uid=USERNAME,gid=users    0       0

Basic NTFS-3G options**

For most, the above settings should suffice. Here are a few other options that are general common options for various Linux filesystems. For a complete list, see this

umask is a built-in shell command which automatically sets file permissions on newly created files. For Arch Linux, the default umask for root and user is 0022. With 0022 new folders have the directory permissions of 755 and new files have permissions of 644. You can read more about umask permissions here.
If noauto is set, NTFS entries in /etc/fstab do not get mounted automatically at boot.
The user id number. This allows a specific user to have full access to the partition. Your uid can be found with the id command.
fmask and dmask
Like umask but defining file and directory respectively individually.

If you are an expert, you too can add in your recommendations here as well.

Thank You,