8

Does there exist any tool which can tell you what the fstab line for a mount should be? Ie. it looks at something which has been mounted manually and tells you the line which you would have to add to /etc/fstab to have the same mount be persistent.

I understand that this might have to be a 'heuristic', or in other words a guess, as to options etc. But it seems like it would nonetheless be very useful.

2 Answers 2

10

You can see some information about currently mounted devices by looking at the contents of /etc/mtab (the syntax is quite similar to the one of /etc/fstab). You should find some useful information about mount options as well.

Otherwise, you can use a simple "fstab generator" like this one:

http://epistel.no/fstab/

4

Have a look at /etc/mtab. It contains list of all currently mounted systems with their parameters. From what I see on my Ubuntu system those lines can be directly copied to /etc/fstab.

Another place worth looking is /proc/mounts.

1
  • The advantage of /proc/mounts is that it is generated by the kernel and thus doesn't get out of sync with reality. The advantage of /etc/mtab is that it sometimes contains some additional details which the mount command keeps track of but the kernel does not keep track of.
    – kasperd
    Dec 8, 2015 at 15:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .