How to add a new entry to fstab?

Posted by Roei on Super User See other posts from Super User or by Roei
Published on 2011-09-13T09:26:08Z Indexed on 2012/12/01 5:08 UTC
Read the original article Hit count: 365

Filed under:

I mount a device mount /dev/xvdf /mnt/mongo and verify the mount using df-h:

Filesystem            Size  Used Avail Use% Mounted on  
/dev/xvda1            7.9G  955M  6.9G  12% /  
tmpfs                 299M   44K  299M   1% /dev/shm  
/dev/xvdf              20G  589M   19G   4% /mnt/mongo  

But now I'm trying to figure out how to make it auto mount on boot.

I understand I need to add a new entry to /etc/fstab, so I perform:

$ sed -i '$ a\/dev/xvdf /mnt/mongo xfs defaults 1 1' /etc/fstab

But, after reboot, it seems that the auto mount didn't work. The device didn't appear in the df -h list.

Should I not use the sed to add the entry? Is the entry I entered incorrect?

© Super User or respective owner

Related posts about linux