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 have a partition mounted with mount -t ext3 /dev/sda3 /foo.

Each time I reboot, I need to remount. How can I keep this mounted after every reboot?

share|improve this question
up vote 17 down vote accepted

You need to make an entry in /etc/fstab for the mount, something like:

/dev/sda3 /foo                       ext3    defaults        1 1

For more information see:

http://www.tuxfiles.org/linuxhelp/fstab.html

share|improve this answer

Sometimes, one may face critical issues due to /etc/fstab entries. So, the alternative is crontab.

Just add below entry in root's crontab.

$ sudo crontab -e

@reboot mount -t ext3 /dev/sda3 /foo

share|improve this answer
1  
Are you really suggesting to use an ugly hack instead of the proper way of doing it, which has been in use for decades and never actually caused those "critical issues" to anyone?!? – Massimo Jul 3 '13 at 7:29
1  
I faced this situation while working on cloud machine on AWS. There was some problem while mounting using /etc/fstab, and the system was halting boot process. So, the system became useless as it was remote. So, i prefer safe boot (without specifying an entry in fstab) and then issue mount in crontab. – Parvinder Singh Oct 25 '13 at 13:22
    
@Massimo actually "critical issues" do exist. Here's what a Google engineer says about mounting a certain cloud storage (like Amazon S3) FUSE filesystem via fstab at boot: "let me urge you to not do this. Requests to GCS are not nearly as reliable as local disk, and you're likely to find yourself with a system that hangs on boot if anything goes wrong" ( here ) – KajMagnus Jul 23 at 14:32
    
Not sure what to do instead though, but crontab and @reboot makes sense to me. Perhaps in combination with a fstab noauto row, or mount directly in the crontab. — Anyway, upvoted from -3 to -2, because this answer is actually useful, in some rare cases. (And edit suggestoin: "sometimes" --> "in rare cases" :- ) ) – KajMagnus Jul 23 at 14:33
    
This is what I did in my case: @reboot echo '/opt/ed/mount-google-cloud-storage-backups-bucket.sh >> /opt/ed/cron.log 2>&1' | at now + 3 minutes, works OK perhaps not for everyone, but for my use case. – KajMagnus Jul 23 at 15:29

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.