Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to mount a device at /dev/sdf and I want it to be mounted for all users once the system has started. It is Ubuntu 10.04 Server.

I think the answer is something like /etc/rcS.d but I can't be certain exactly...

Many thanks, Chris.

share|improve this question
possible duplicate of How to run a command at boot up automatically? – Ignacio Vazquez-Abrams Nov 21 '10 at 15:21
up vote 11 down vote accepted

Generally, if you want a filesystem to mount when your system boots you add an entry to /etc/fstab. Entries in fstab looks something like this:

/dev/sda2 /home ext4 defaults  1 2


<device> <mountpoint> <filesystem_type> <options> <dump_frequency> <fsck_pass>

The last two fields are no longer terribly important; you can typically duplicate them from existing entries in your file.

share|improve this answer

You're going to want to use the file /etc/fstab. It contains all the filesystems that should be mounted at boot time. Read the man page for fstab(5) for more information, but the line you need to add should look something like this

# dev         mount point           fstype  fs_options   dump   fsck
/dev/sdf    /path/to/mount/point    ext4    defaults      1      2
share|improve this answer

I would put it in /etc/fstab where all system-wide mounts are defined.

share|improve this answer

There is a /etc/rc.local script executed at the end of each multiuser runlevel

share|improve this answer
You should never be mounting things in the runlevel inits. – Andrew M. Nov 21 '10 at 15:37

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.