Boot Very Slow After Adding HD to fstab

I have an external hard drive that I use with my laptop and I want it to be mounted at boot.

I used YaST to do this by using the Partitioner. I selected the volume, then edited then chose to have the partition mounted at boot.

On next book the computer booted up and mounted the device as I expected but the boot up process took a long time. When I would usually get the desktop I got only a black screen for about one minute, the the desktop finally loads. I tried to reboot a number of times but I still get the same delay.

When I go back and choose to have the hard drive not auto mount and then reboot there is no delay in loading the desktop. So it seems like mounting this device is delaying the loading of my desktop on boot somehow.

I googled and was unable to find anything like this. Does anyone have any idea what is causing this problem, and how I can fix it?

Below is the line that is added to my fstab file to auto mount the drive:

/dev/disk/by-id/usb-WD_10EACS_External_57442D574341553433393639343234-0:0-part1 /media/MyBook vfat users,gid=users,umask=0002,utf8=true 0 0

Here is the content of my fstab before the change:

/dev/disk/by-id/ata-Hitachi_HTS541616J9SA00_SB2481SJKEB9ZE-part5 swap swap defaults 0 0
/dev/disk/by-id/ata-Hitachi_HTS541616J9SA00_SB2481SJKEB9ZE-part1 / ext4 acl,user_xattr 1 1
proc /proc proc defaults 0 0
sysfs /sys sysfs noauto 0 0
debugfs /sys/kernel/debug debugfs noauto 0 0
devpts /dev/pts devpts mode=0620,gid=5 0 0

OK, you need to remove that entry. USB devices are not entered in fstab.

You can manually edit fstab
FSTAB - Editing Manually - openSUSE Forums

When you have done this, reboot and tell us what you see in /media

What desktop are you using BTW

I have removed the line from fstab and rebooted. I do not have that delay in loading the desktop.

In the media folder I have a MyBook folder that I had created for the device being mounted but it is now empty.

I am using KDE 4.3.

You do not need to create a folder in /media

Check in dolphin, make sure you have ‘Places’ enabled from the View Menu.
Is Places showing your My Book drive?
If not, pull the drive. Go back to /media and delete the folder you created there.

Now plug the device back in. Does the device notify popup? Does it appear in Dolphin - Places?

If not open a terminal, become su and do

fdisk -l

post result

I do have places enabled in the view menu and My Book is showing in the Places pane. It always has though. The problem is that none of my applications are able to read any of the contents of the drive until I navigate to it.

Is there a way to have the device mounted on boot so that applications can access the contents?

This is normal behaviour

Well, as the OP has a solution (more or less), do you mind when I hop in asking a few questions?

Can anybody tell me WHY USB mass storage devices should not go into the fstab? I have advocated in these forums more then once that not the type of connection (USB, IDE, …) must be the deciding factor, but the intended usage of the device.

. When one (including apparently the OP) wants to have this device mounted as long as the system runs, on a place of ones own whish, then use good old fstab. It will see that it mounts at boot (some people refer to this with the misnomer ‘automounting’).

. When the device is connected by the loged in user for his usage, then one can (must, I am afraid) use the services of HAL. HAL will mount it on a directory of its own choice (following know rules) inside the directory /media. And HAL will make the device available to (one of the loged in) user(s) by making this user the owner of the mountpoint (and then signal the DE). The whole idea of this is no doubt inspired ny the fact that the modern PC can be adorned on the flight with all sorts of devices that are called ‘media’.

I do not understand why a TB disk, attached to the system at all times, having maybe several partitions that should be mounted on several places should not be handled by fstab just because it is connected by USB. My not understanding raises to suspicion of superstition (is this still correct English?) when people think that when the device is placed beside the main box, this is called ‘external’ and as such should be handled completely different from the device that happens to be ‘internal’.

I admit that the OP has a problem, but I want to understand what his problem is. The solution given to him is just a bypass. In other threads I have made people happy by showing them the way how to use fstab for always connected USB devices.

In other words, I want to know why I am wrong and why the saying goes that one should not put USB devices in/etc/fstab.

I don’t know the answer to this @Henk

Maybe it’s OK. I do know it’s not normal to use fstab in this way.

My guess is it would behave better using an entry like this

/dev/sdc1 /media/MyBook        vfat vfat users,gid=users,umask=0002,utf8 0 0

Might be worth experimenting

I tried to find all the differences between the entry markcfernando uses and the one you propose, but it seems that you only changed the usage of the /dev/disk/by-id/xxxx-part1 to /devsdc1 (and a typo mentioning vfat two times :wink: ). That can’t be his problem. /dev/disk/by-id-part1 is only a symbolic link to /dev/sdc1 an as such represents the same. You can check this by doing

mount

It will show everything mounted by the short name, even if you have the long names in your fstab (that is what openSUSE does by default, so you can check this on your own system without changing anything).

The advantage of using by-id is that when you add more devices and after reboot the same disk is now at /dev/sdd1 (because these a, b, c, d are given out in the sequence the system detects the devices), the symbolic link in /dev/disk/by-id is now pointing to /dev/sdd1 (thanks to udev). And that is as designed to cure exactly this kind of problems of not persistent naming.

IMO it is because you have two process trying to mount the device. The forced mount at fstab and HAL. In a modern OS these process maybe running in parallel to speed up startup.

Also since the USB device is “removable” the OS has no guarantee what it will find attached if anything no matter what the users intension where when they set it up. Maybe the user forgot to turn it on…users are like that you know. Best intentions and all that.

BTW if you want to see the device at some other address the easiest way is to simply link to it. I have done that with backup software that did not want to write out side my home just set up a link in home to /media/my book

When I boot in and use the mount command in terminal it does not show my external HD. After I open it with Dolphin then run the mount command in terminal it does appear. It shows as:

/dev/sdb1 on /media/My Book type vfat (rw,nosuid,nodev,uid=1000,utf8,shortname=mixed,flush)

A little different from what I had inserted when using the partitioner. I will try adding this to fstab and see if that does the trick.

I used the code in the fstab file and the device is successfully mounted, but I still have that 1 minute delay before the desktop is loaded. I just have a black screen but any apps I had opened are up just that the desktop is all black and there is no taskbar.

Any ideas?

Apparently this is functionality that is not present in KDE 4.3, but will be present in KDE 4.4. It was also present in KDE 3.x. Here’s the post.

@gogalthorp
I do not think that two processes are fighting to mount the same device. The HAL documentation states that it will not do anything with a device that has ann entry in /etc/fstab.

You can remove a so called ‘internal’ device also. All precautions that can be taken against a device not showing up at boot, or removed without notice are the same.

Yes, a symbolic link might help. But take care, HAL is not persistent in the mount points it gerates. It only tries to be. When there is already a device mounted at /media/disk, it will mount at /media/disk-1. I mentioned a thread where I advised to use the fstab for an USB device. That was exactly because HAL used not allways the same mount point for his device.

The problem with HAL is that it tries to mimic what you (as system manager) would do when your end-user says: “Hey mount that USB-stick for me”.
. HAL first looks if there is an entry in /etc/fstab. When yes, it supposes that the device is not to be handled by him, not to frustrate what the system manager already prepared.
. It has to make a mount point and for that it makes some arbritrary decisions. I might be a bit sarcastic, but admit that it is difficult to guess in the wild what to do and the designers decided for a solution. They choose /media. And because there may be more things to be mounted, they decided to create inside /media. And they also decided that they would put HAL’s administration files inside /media (look for the files starting with . ). They decided to use the partition label as the name of the mount point. When not available, HAL will use the Class of the device (that is where the ‘disk’ comes from. And when already in use, a -1, -2, etc. is added.
. Next decision is about access. They create the mountpoint with the end-user as owner. Which end-user? Again a problem because Linux is a multi user/multi thread system. There can be more users active then one. The story of the father, mother and daughter that were all loged in is already told on this forums.
. Next HAL tries to find out what the fs-type of the device is. This often succeeds (but not always).
. This all settled, HAL willl use a mount statement like every other system manager (as root).
. As last HAL will, via DBUS, signal the Desktop Environment of the user. That DE will then show you a pop-up, or whatever it thinks fit to do.

Most of the above (the basics) is (as I always point to) at SDB:Basics of partitions, filesystems, mount points - openSUSE.
Maybe I should have forced people to read this first before they ask more questions.

I am still waiting for prove that it is unwise to put USB devices in fstab instead of: they told me that they are told that perhaps … Because these rumours can have a long, long life and still be nonsense.

That is about the last part of the chain. So it seems that they broke KDE >:)

But I do not believe that that has anything to to with the wait time you expirience when mounting it a boot via /etc/fstab. In that case it is just a mounted partition and the DE has nothing to do (it is not even there at that moment in time). It is the same as mounting your /home.

Just a note here:

I don’t use mounts in fstab for my Elements USB device 500GB. And I can tell you it is real slow comming to life, I guess it takes 30+ seconds. I used the same device in 11.0 and it was 5 seconds and the same in Fedora10&11.

So something is different in 11.2
Even a FAT32 Partition on a internal HD takes about 10 seconds to mount.

I’m talking 1st time from Up. After this it’s fine. Though the Elements device does spin down so there is a pause if I haven’t used it in the last 30 mins.

So thinking on the above.
Perhaps the same delay is happening at boot of such devices in fstab?

It is all a bit confusing.

I do not believe in a different way of mounting during boot (because a simple mount -a is done), mounting later by someone using the *mount *statement as root, or HAL using the *mount *statement (or the same interface to the kernel as *mount *does).

Having said that, a disk that needs time to spin up can cause delay. The delay is for the process that does the mount (and everything waiting for that process to finish). That is you staring at the *mount *statement and waiting for the prompt in the first place. IMHO other processes that has nothing to wait for, should carry on.

@markcfernando
You say your desktop is black, but applications show (having windows I presume, just the windows or also the borders, buttons, etc?). Is this irrespective of how long you wait after boot before you log in? Or do you have autologin on, thus giving no clue as to when the boot stops and the login starts?

Yes I have auto log in disabled. It shows the window plus all of the contents. Everything outside the window border is black though. No task bar either, just the windows. The windows are there when I would expect the desktop to appear and are coincident with the log in sound. Then after 50 seconds the desktop appears.

Strange, when you wouldn’t have told that it appears and disappears with the mount at boot time of that fs, I would not believe it :wink:

Just something that comes to my mind as what I would do, trying to gather more informatiom about this:
After boot, do not log in in the GUI, but do Ctrl-Alt-F1 to go to the logical console. Log in as root (yes, I know about all the do NOT …, but in this case the chance that somebody is spying on you is almost nil, look over your shoulder). Then check if the fs is there with

mount

and go there with

cd /media/My..

ad a bit deeper to chek if it is allready there. Of course al his as quick as possible and be aware of long waits. Logout

exit

and do Ctrl-Alt-F7 to go to the DM login and see if s still on minute of darkness.

Hmmm, I’ve had something very similar starting to happen in the last couple of days: suddenly boot takes much longer than before, with windows appearing against black background (and HPLIP complaining it can’t find System Tray), then everything resolves itself. Can’t remember changing anything significant in the setup, it does look like it’s do do with the mounted network drives spinning up but then again they’ve been mounted (through fstab of course) for ages.
Not sure this is directly connected with your issue but I’ll be watching this thread with interest…