Red HatThis forum is for the discussion of Red Hat Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
hi friends
plz help me
I am using rhel6....
i have accidentlly deleted my fstab file.
help me to recover it.....if any one have the solution please post it.
If it's still alive (not rebooted) then maybe something like 'egrep -v "(rootfs|/dev/root|sysfs|selinuxfs|usbfs|binfmt_misc)" /proc/mounts > /etc/fstab' could be a start?
sir i reboot my system and i try to recover but i cant plz help me
and i have no backup of fstab
Well, your only chance would be to try to manually mount the partitions one at a time (go into fdisk, and print the partition table, to get an idea of what partitions may be which devices). From there, you can try to create an fstab manually.
Otherwise, you've now learned the importance of having backups, and you may have to reload/reinstall your OS. If you made a separate partition of your /home, you don't have to format that at build time, so you can save that data.
...in addition fdisk shows devices but not partition labels (as in 'disktype '/dev/devicename' or 'ls -l /dev/disk/by-label'). On simple disks, using something like
Code:
for DISK in /dev/{h,s}d[a-z]; do
fdisk -l $DISK|awk '/Linux$/ {print $1}'|while read PART; do
LABEL=$(tune2fs -l $PART|awk -F':' '/Filesystem volume name:/ {print $2}')
echo "${PART} ${LABEL// /} ext2 defaults 0 0"; done; done
may show Linux (0x83) partitions and their labels, *if* you gave them usable names. You probably also want to add the
* And apart from the valuable lesson wrt having backups you've also learned that next time you mess around you do it as unprivileged user and not root.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.