Automount problems on 2nd HDD partitions

Hi everybody,

I want to ask help to you, because I’m going crazy with my problem.
At first I must say that I’m totally new Suse and Linux world, but step by step I want to know them properly.

The machine in wich I installed OpenSuse 12.3 with KDE is a Proliant microserver N40L from HP. I want to use that as home server for sharing files over my wired and wifi network and for remote control. But my problem stay on the first point: sharing.

I have a first HDD with / partition of 20 GB, a SWAP partition and a 210GB /home partition - everything works fine
I have a secondary HDD, WD caviar green 3TB, divided into two partitions ext4, the first of 1,9 Tb (Data) and the second of 869 GB (condivision).

Everytime after boot I must go on home with Yast and manually mount both partitions of WD (data+Condivision) to work on them. I’ve tried to select the automount option, but it desn’t work. Both partitions are mounted on /var/run/media/lol-9000 (my usr ID), but I didn’t get myself that mount point. If I use the Partitioner I can choose only theese mount points:

  • /run/media/lol-9000/Condivision
  • /srv
  • /tmp
  • /usr/local

On my dreams I hope to have Suse mount my partition on boot, so I can try to configure SAMBA

Can anybody help me? I’m sure thats 'cause I’m newbie :frowning:
thanks

Hello and welcome here.

Apart from your story, we can realy only give good advice when you also show computer facts. That is normaly done by copy/paste of terminal text into a post here. To keep that readable, this copy/paste must be in the post between CODE tags. And you get the CODE tags by clicking on the # button in the tool bar of the post editor. And please always copy the prompt, the command and output and the next prompt all together.

Please, using this facility, post the output of:

fdisk -l

and

cat /etc/fstab

Also please tell how you did the partitioning of that disk. Did you use YaST > System > Partitioning? I doubt, because when using YaST it is almost impossible to miss the field where you enter your mountpoint. And the YaST will create the appropriate entry in /etc/fstab. Which I guess is missing (or corrupt). But that we will see from the output you post.

And as you say you are new to the Linux world, the following might b of interest whith respect to partitions, file systems and mounting: SDB:Basics of partitions, filesystems, mount points - openSUSE

Thanks a lot for your info, I didn’t see the CODE option

fdisk -l (L) doesn’t work. maybe I must add something before it, but I don’t know what. Sudo doesn’t work

lol-9000@linux-4b7u:~> fdisk -l
Absolute path to 'fdisk' is '/usr/sbin/fdisk', so running it may require superuser privileges (eg. root).
lol-9000@linux-4b7u:~> sudo fdisk -l
sudo: fdisk: comando non trovato

and the result of cat /etc/fstab

lol-9000@linux-4b7u:~> cat /etc/fstab
/dev/disk/by-id/ata-VB0250EAVER_S2A7FM54-part1 swap                 swap       defaults              0 0
/dev/disk/by-id/ata-VB0250EAVER_S2A7FM54-part2 /                    ext4       acl,user_xattr        1 1
/dev/disk/by-id/ata-VB0250EAVER_S2A7FM54-part3 /home                ext4       acl,user_xattr        1 2
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

seems it shows only 1 HDD
thanks again

Sorry, my fault, it should be

su -c 'fdisk -l'

and it will ask for the root password.

And indeed, as I assumed, there is no entry for any of your file systems on the second disk in the fstab. Thus nothing will be mounted from there at boot.

But you didn’t answer my question on how you partitioned that disk and created the ext4 file systems on it. Again, use YaST > System > Partitioning to do that task. In this case, because you have the partitions already and you do have the ext4 file systems on them also (and I guess there is also data on them that you not want to be destroyed), do not format (which means “creating an fs”) only thing to do is specifying the mount points for those two.

here the result of fdisk

Disk /dev/sda: 250.1 GB, 250059350016 bytes
255 testine, 63 settori/tracce, 30401 cilindri, totale 488397168 settori
Unità = sectors di 1 * 512 = 512 byte
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Identificativo disco: 0x000eb9e6

Dispositivo Boot      Start         End      Blocks   Id  System
/dev/sda1            2048     4208639     2103296   82  Linux swap / Solaris
/dev/sda2   *     4208640    46153727    20972544   83  Linux
/dev/sda3        46153728   488396799   221121536   83  Linux

Disk /dev/sdb: 3000.6 GB, 3000592982016 bytes
255 testine, 63 settori/tracce, 364801 cilindri, totale 5860533168 settori
Unità = sectors di 1 * 512 = 512 byte
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Identificativo disco: 0x000740e0

Dispositivo Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048  4097204223  2048601088   83  Linux
/dev/sdb2      4097204224  5860532223   881664000   83  Linux


the two partitions where created with Gparted, from a live Ubuntu cd distro. at the moment there are not data (everything saved) so the format option is not a problem.
If I go on Yast>System>Partition a window opens and there are all the partition of all disks displayed; right click on one of those 2>modify>new window with format and mount options, but there are only those :
/run/media/lol-9000/condivisione
/srv
/tmp
/usr/local

searching a lot I’ve found that theese mount point are from /var (so it would be /var/run/media/…)

sorry if I didn’t answered properly on firt time

/var/run/media and /run/media is exactly the same. (the first one is only there for compatibility reasons)

But I don’t see your problem. Just enter any path as mount point in YaST->Partitioner (with the keyboard) depending on where you want to mount it. Anything will do like “/mnt” or “/media/mydrive”, of course that directory should exist. If not you may have to create it manually.
You don’t have to format the drive for that.

Or manually create a line in /etc/fstab.

Like wolfi323 said. Only difference is that I believe that YaST will create the mountpoint for you when it does not exist.

In any case, it is you, as system manager, that has to decide where you want to mount them (I hope you read the link I pointed you to, else I have to repeat things). And where you want them mounted depends of course where you want to use them for.

PS I wouldn’t use /media. IMHO that is reserved for system usage and (while a tmpfs in RAM), you will loose your mountpoint at every shutdown.

On 12.3 it is no tmpfs.
But udisks1 still uses it for mounting (don’t know right now what still uses udisks1 though ;)). And udisks2 uses it for mounting shared drives (otherwise it uses /run/media/$USER).

So on 12.3 you CAN create a subdirectory in /media and use that as mountpoint. (well, you also could on <=12.2, but since it is a tmpfs there, you would have to recreate the subdirectory on every boot by a file in /etc/tmpfiles.d/)

And if udisks/udisks2 want to mount to a directory that already exists, they append “-1”, “-2” and so on. So there won’t be conflicts when you use /media/mydisk…

Anyway, /media/mydisk was just an example.
You could also use /mydisk or /mnt/disk or /windows/C or whatever you like…:wink:

Is there an automount script or something that will mount all hard drives at boot time?

When I try to mount sda1 or hdi1 from a live disk I built with OpenSuSe Studio I get a not found error in /etc/fstab
So how do I get it to autodetect hard drives at boot up?

Which packages do I need besides libmount1 ?

It does not auto-mount. The boot simply mounts what is in the fstab file period.

You can set what mounts in the Yast Boot sections or hand editing /etc/fstab by hand as root

Do I just copy what is in the device by path folder ( /dev/path/ ) to the ( /etc/fstab ) folder?
Or is it more involved than that? Or am I supposed to copy from the ( /dev/uuid/ ) folder instead?

Or can I just put an (sda) in the ( /etc/fstab ) folder at creation compile time so that the finished disk will mount the hard drive during boot?
I haven’t quite figured out how ‘Trinity Rescue Kit’ does what it does yet.
If I could find where it stores its ‘mount all drives’ script and find out what it takes to make that work on a different distribution
then all I would have left to worry about is what all it takes for a workable C++ IDE.

Preferred is /dev/disk/by-id/

But other methods will work but each has their pluses or minuses Avoid sdX notations since that can change boot to boot.

You also must have the parameters right for the device and who gets the usage permissions etc.

Note you can also set the drives from Yast-boot section if you are more comfortable in a GUI