Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
1  
possible duplicate of How to run a command at boot up automatically? –  Ignacio Vazquez-Abrams Nov 21 '10 at 15:21

4 Answers 4

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

That's:

<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

 
discard

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.