On 12 May 12:27, Mark Rogers wrote:
Brett Parker wrote:
Well, assuming that you haven't unmounted anything, you should be able to get enough info from the output of /proc/mounts to rebuild your /etc/fstab...
(infact, there's every possibility that you can remove a few things from there... like the tmpfs mounts, and probably /dev, which will be done automatically by udev anyways.)
In the good old days I understood fstab, but now with UUIDs etc I'm a bit out of date.
I haven't unmounted anything so I have all the information I need, if only I can work out how to use it. What I have to work from is:
$cat /proc/mounts rootfs / rootfs rw 0 0 none /sys sysfs rw,nosuid,nodev,noexec 0 0 none /proc proc rw,nosuid,nodev,noexec 0 0 udev /dev tmpfs rw,relatime 0 0 fusectl /sys/fs/fuse/connections fusectl rw,relatime 0 0 /dev/disk/by-uuid/c753a899-0637-4963-9f77-a825051bb917 / ext3 rw,relatime,errors=remount-ro,data=ordered 0 0 /dev/disk/by-uuid/c753a899-0637-4963-9f77-a825051bb917 /dev/.static/dev ext3 rw,relatime,errors=remount-ro,data=ordered 0 0 tmpfs /var/run tmpfs rw,nosuid,nodev,noexec 0 0 tmpfs /var/lock tmpfs rw,nosuid,nodev,noexec 0 0 tmpfs /dev/shm tmpfs rw,relatime 0 0 devpts /dev/pts devpts rw,relatime 0 0 tmpfs /var/run tmpfs rw,nosuid,nodev,noexec 0 0 tmpfs /var/lock tmpfs rw,nosuid,nodev,noexec 0 0 securityfs /sys/kernel/security securityfs rw,relatime 0 0
Does something like this look reasonable? (I can't think of a way to test safely) proc /proc proc defaults 0 0 UUID=c753a899-0637-4963-9f77-a825051bb917 / ext3 defaults,errors=remount-ro 0 1
It looks a bit sparse, to say the least! Should I have something in there for swap and CD (neither of which are in the mount output)?
That looks good for the root filesystem...
Yes, you'll want the swap device too, at least, and you'll want the path for the cdrom drive...
So, something more like:
--- Start fstab ---
proc /proc proc defaults 0 0 UUID=c753a899-0637-4963-9f77-a825051bb917 / ext3 defaults 0 0 /dev/sda2 none swap sw 0 0 /dev/cdrom /media/cdrom0 udf,iso9660 user,noauto 0 0
--- End fstab ---
You can find the name of the swap partition using:
# swapon -s
/dev/cdrom, assuming there's udev, should really point to the first CD drive available (but check in /dev, it maybe that you need to use /dev/cdrom1 or similar)
Cheers,