Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I accidentally removed all the entries from the fstab files while doing a backup (Yeah, I know ;)).

I would like to know if there is a way to rebuild it with the current mount options, since I did not restart the server since the deletion. If there is no such program, could anybody help me rebuild it.

Using this, I have found the command to show the current setup, but I don't know what to do with it.

$ sudo blkid
/dev/sda1: UUID="3fc55e0f-a9b3-4229-9e76-ca95b4825a40" TYPE="ext4" 
/dev/sda5: UUID="718e611d-b8a3-4f02-a0cc-b3025d8db54d" TYPE="swap" 
/dev/sdb1: LABEL="Files_Server_Int" UUID="02fc2eda-d9fb-47fb-9e60-5fe3073e5b55" TYPE="ext4" 
/dev/sdc1: UUID="41e60bc2-2c9c-4104-9649-6b513919df4a" TYPE="ext4" 
/dev/sdd1: LABEL="Expansion Drive" UUID="782042B920427E5E" TYPE="ntfs" 


$ cat /etc/mtab
/dev/sda1 / ext4 rw,errors=remount-ro 0 0
proc /proc proc rw,noexec,nosuid,nodev 0 0
none /sys sysfs rw,noexec,nosuid,nodev 0 0
none /sys/fs/fuse/connections fusectl rw 0 0
none /sys/kernel/debug debugfs rw 0 0
none /sys/kernel/security securityfs rw 0 0
none /dev devtmpfs rw,mode=0755 0 0
none /dev/pts devpts rw,noexec,nosuid,gid=5,mode=0620 0 0
none /dev/shm tmpfs rw,nosuid,nodev 0 0
none /var/run tmpfs rw,nosuid,mode=0755 0 0
none /var/lock tmpfs rw,noexec,nosuid,nodev 0 0
none /lib/init/rw tmpfs rw,nosuid,mode=0755 0 0
none /var/lib/ureadahead/debugfs debugfs rw,relatime 0 0
/dev/sdc1 /home ext4 rw 0 0
/dev/sdb1 /media/Files_Server ext4 rw 0 0
binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,noexec,nosuid,nodev 0 0
/dev/sdd1 /media/Expansion\040Drive fuseblk rw,nosuid,nodev,allow_other,blksize=4096,default_permissions 0 0
gvfs-fuse-daemon /home/yvoyer/.gvfs fuse.gvfs-fuse-daemon rw,nosuid,nodev,user=yvoyer 0 0
/dev/sdd1 /media/Backup500 fuseblk rw,nosuid,nodev,sync,allow_other,blksize=4096,default_permissions 0 0
/dev/sr0 /media/DIR-615 iso9660 ro,nosuid,nodev,uhelper=udisks,uid=1000,gid=1000,iocharset=utf8,mode=0400,dmode=0500 0 0
gvfs-fuse-daemon /home/cdrapeau/.gvfs fuse.gvfs-fuse-daemon rw,nosuid,nodev,user=cdrapeau 0 0

share|improve this question

1 Answer 1

up vote 5 down vote accepted

Well, I don't know of an automated way to restore it, but from your paste, created by hand..

# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc /proc proc nodev,noexec,nosuid 0  0
UUID=3fc55e0f-a9b3-4229-9e76-ca95b4825a40 / ext4 errors=remount-ro 0 1
UUID=718e611d-b8a3-4f02-a0cc-b3025d8db54d none swap sw 0 0 
UUID=41e60bc2-2c9c-4104-9649-6b513919df4a /home ext4 defaults 0 0
UUID=02fc2eda-d9fb-47fb-9e60-5fe3073e5b55 /media/Files_Server ext4 defaults 0 0

Please wait for a couple of other people review and approve this before you blindly copy and reboot with it, a second set of eyes is always good ;)

I've left out sdd and sr0 as they look like they're done by gvfs.

share|improve this answer
    
Thanks, but you didn't specify anything about cd-rom "/media/cdrom/", is it normal? –  yvoyer Nov 22 '11 at 16:09
    
Sorry, should have said, I'll edit my answer. Yes I left that out intentionally too, as it's also handled by gvfs, automatically mounted when you insert a disc. –  Caesium Nov 22 '11 at 16:13
    
Is it better to restart or to run mount -a. With the mount -a option, could it break everything, or will it gives me warnings? Thanks very much. –  yvoyer Nov 22 '11 at 16:26
    
mount -a will do precisely nothing if the lines in fstab are already mounted. You should see exactly zero output. So yes, I think you can safely try that. If you do get any messages it indicates an fstab line might be wrong. It is very unlikely to break anything though. –  Caesium Nov 22 '11 at 16:28

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.