Linux - Server This forum is for the discussion of Linux Software used in a server related context.
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
08-31-2015, 08:15 AM
#1
Member
Registered: Feb 2013
Posts: 212
Rep:
/etc/fstab overwritten Please help to recover
Hi,
By mistakenly i overwritten /etc/fstab like below
echo "bigfoot:/t6_dump /t6_dump nfs ro,sync,tcp,nfsvers=3,rsize=262144,wsize=262144 0 0" > /etc/fstab
instead of using >> i have used it > It has 50 servers all got overwritten with above entry and i don't have backup.
[root@vncin47 etc]# cat /proc/mounts
rootfs / rootfs rw 0 0
/dev/root / ext3 rw,data=ordered 0 0
/dev /dev tmpfs rw 0 0
/proc /proc proc rw 0 0
/sys /sys sysfs rw 0 0
/proc/bus/usb /proc/bus/usb usbfs rw 0 0
devpts /dev/pts devpts rw 0 0
/dev/sda1 /boot ext3 rw,data=ordered 0 0
tmpfs /dev/shm tmpfs rw 0 0
none /proc/sys/fs/binfmt_misc binfmt_misc rw 0 0
sunrpc /var/lib/nfs/rpc_pipefs rpc_pipefs rw 0 0
bigfoot:/ecad /ecad nfs ro,sync,vers=3,rsize=262144,wsize=262144,hard,proto=tcp,timeo=600,retrans=2,sec=sys,addr=bigfoot 0 0
bigfoot:/pd1 /pd1 nfs ro,sync,vers=3,rsize=262144,wsize=262144,hard,proto=tcp,timeo=600,retrans=2,sec=sys,addr=bigfoot 0 0
bigfoot:/pd3 /pd3 nfs ro,sync,vers=3,rsize=262144,wsize=262144,hard,proto=tcp,timeo=600,retrans=2,sec=sys,addr=bigfoot 0 0
bigfoot:/pd5 /pd5 nfs ro,sync,vers=3,rsize=262144,wsize=262144,hard,proto=tcp,timeo=600,retrans=2,sec=sys,addr=bigfoot 0 0
bigfoot:/pd6 /pd6 nfs ro,sync,vers=3,rsize=262144,wsize=262144,hard,proto=tcp,timeo=600,retrans=2,sec=sys,addr=bigfoot 0 0
bigfoot:/pd8 /pd8 nfs ro,sync,vers=3,rsize=262144,wsize=262144,hard,proto=tcp,timeo=600,retrans=2,sec=sys,addr=bigfoot 0 0
bigfoot:/dv3 /dv3 nfs rw,sync,vers=3,rsize=262144,wsize=262144,hard,proto=tcp,timeo=600,retrans=2,sec=sys,addr=bigfoot 0 0
asteroid:/dv4 /dv4 nfs rw,vers=3,rsize=65536,wsize=65536,hard,proto=tcp,timeo=600,retrans=2,sec=sys,addr=asteroid 0 0
asteroid:/dv5 /dv5 nfs rw,vers=3,rsize=65536,wsize=65536,hard,proto=tcp,timeo=600,retrans=2,sec=sys,addr=asteroid 0 0
bigfoot:/dv6 /dv6 nfs rw,vers=3,rsize=65536,wsize=65536,hard,proto=tcp,timeo=600,retrans=2,sec=sys,addr=bigfoot 0 0
/etc/auto.misc /misc autofs rw,fd=6,pgrp=2822,timeout=300,minproto=5,maxproto=5,indirect 0 0
-hosts /net autofs rw,fd=12,pgrp=2822,timeout=300,minproto=5,maxproto=5,indirect 0 0
auto.home /home autofs rw,fd=18,pgrp=2822,timeout=60,minproto=5,maxproto=5,indirect 0 0
10.193.182.150:/hw_home/murali /home/murali nfs rw,vers=3,rsize=1048576,wsize=1048576,hard,proto=tcp,timeo=600,retrans=2,sec=sys,addr=bigfoot 0 0
bigfoot:/pd7 /pd7 nfs ro,sync,vers=3,rsize=262144,wsize=262144,hard,proto=tcp,timeo=600,retrans=2,sec=sys,addr=bigfoot 0 0
I got nfs share mount point info and but i did not get system mount point info
If any one server reboots it wont boot. Is there any way i can restore before server reboot? Please help. Immediate help is highly appreciated.
Last edited by sagar666; 08-31-2015 at 08:18 AM .
08-31-2015, 08:43 AM
#2
Member
Registered: Apr 2009
Location: Oz
Distribution: slackware64-14.0
Posts: 875
First "cat /proc/mounts > /etc/fstab"
It wont be pretty but it should let it boot, actually it will have an incorrect / partition as yours is showing /dev/root (fix it manually)
You'll have to clean it up from that depending on your distro's startup files some of those mounts will be done directly.
08-31-2015, 08:50 AM
#3
Member
Registered: Feb 2013
Posts: 212
Original Poster
Rep:
Thanks for the quick help and its RHEL 5.7. Please help me how exactly need to be modify for root filesystem.
blkid shows
/dev/sr0: LABEL="RHEL/5.7 x86_64 DVD" TYPE="iso9660"
/dev/sda5: LABEL="/share" UUID="4f1dbed0-3ab9-4ec1-b6e7-3db6a1974e30" TYPE="ext3"
/dev/sda3: LABEL="SWAP-sda3" TYPE="swap"
/dev/sda2: LABEL="/" UUID="76635581-564e-42b3-a596-2d0d46d1fb13" TYPE="ext3"
/dev/sda1: LABEL="/boot" UUID="097e37c6-0113-441f-8c5e-3abcdcc5fcf5" TYPE="ext3"
/dev/sda2: LABEL="/" UUID="76635581-564e-42b3-a596-2d0d46d1fb13" TYPE="ext3" is root right?
Last edited by sagar666; 08-31-2015 at 08:52 AM .
08-31-2015, 08:53 AM
#4
Moderator
Registered: Aug 2002
Posts: 25,699
Post the output of the command
/sbin/blkid
08-31-2015, 08:59 AM
#5
Member
Registered: Feb 2013
Posts: 212
Original Poster
Rep:
blkid shows
/dev/sr0: LABEL="RHEL/5.7 x86_64 DVD" TYPE="iso9660"
/dev/sda5: LABEL="/share" UUID="4f1dbed0-3ab9-4ec1-b6e7-3db6a1974e30" TYPE="ext3"
/dev/sda3: LABEL="SWAP-sda3" TYPE="swap"
/dev/sda2: LABEL="/" UUID="76635581-564e-42b3-a596-2d0d46d1fb13" TYPE="ext3"
/dev/sda1: LABEL="/boot" UUID="097e37c6-0113-441f-8c5e-3abcdcc5fcf5" TYPE="ext3"
08-31-2015, 09:22 AM
#6
Moderator
Registered: Aug 2002
Posts: 25,699
No backups?
I would save the output of /proc/mounts to a file but not /etc/fstab. I do not see the /share mounted but you can add it. I can not guarantee it matches the original minus the nfs mounts but should boot...
Code:
LABEL=/ / ext3 rw 0 0
LABEL=/boot /boot ext3 rw,data=ordered 0 0
/LABEL=SWAP-sda3 swap swap defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts defaults 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
Last edited by michaelk; 08-31-2015 at 01:07 PM .
1 members found this post helpful.
08-31-2015, 10:17 AM
#7
Member
Registered: Feb 2013
Posts: 212
Original Poster
Rep:
thanks a lot michaelk and No backup,
I have changed to /etc/fstab/ like below. anything wrong in below file or I need to put format like above you mentioned?
/dev/mapper/VolGroup00-LogVol00 / ext3 rw 0 0
proc /proc proc rw 0 0
sysfs /sys sysfs rw 0 0
devpts /dev/pts devpts rw,gid=5,mode=620 0 0
/dev/sda1 /boot ext3 rw 0 0
tmpfs /dev/shm tmpfs rw 0 0
none /proc/sys/fs/binfmt_misc binfmt_misc rw 0 0
sunrpc /var/lib/nfs/rpc_pipefs rpc_pipefs rw 0 0
bigfoot:/ecad /ecad nfs ro,sync,tcp,nfsvers=3,rsize=262144,wsize=262144 0 0
bigfoot:/pd1 /pd1 nfs ro,sync,tcp,nfsvers=3,rsize=262144,wsize=262144 0 0
bigfoot:/pd3 /pd3 nfs ro,sync,tcp,nfsvers=3,rsize=262144,wsize=262144 0 0
bigfoot:/pd5 /pd5 nfs ro,sync,tcp,nfsvers=3,rsize=262144,wsize=262144 0 0
bigfoot:/pd6 /pd6 nfs ro,sync,tcp,nfsvers=3,rsize=262144,wsize=262144 0 0
bigfoot:/pd8 /pd8 nfs ro,sync,tcp,nfsvers=3,rsize=262144,wsize=262144 0 0
bigfoot:/dv3 /dv3 nfs rw,sync,tcp,nfsvers=3,rsize=262144,wsize=262144 0 0
asteroid:/dv4 /dv4 nfs rw,tcp,nfsvers=3,rsize=65536,wsize=65536 0 0
asteroid:/dv5 /dv5 nfs rw,tcp,nfsvers=3,rsize=65536,wsize=65536 0 0
bigfoot:/dv6 /dv6 nfs rw,tcp,nfsvers=3,rsize=65536,wsize=65536 0 0
bigfoot:/pd7 /pd7 nfs ro,sync,tcp,nfsvers=3,rsize=262144,wsize=262144 0 0
bigfoot:/t6_dump /t6_dump nfs ro,sync,tcp,nfsvers=3,rsize=262144,wsize=262144 0 0
Thanks
08-31-2015, 10:51 AM
#8
Moderator
Registered: Aug 2002
Posts: 25,699
Yes, you did not include swap and your / does not belong to a LVM. Those values are the defaults so it should not matter.
Does not go in fstab.
none /proc/sys/fs/binfmt_misc binfmt_misc rw 0 0
sunrpc /var/lib/nfs/rpc_pipefs rpc_pipefs rw 0 0
Last edited by michaelk; 08-31-2015 at 11:28 AM .
Reason: Additional info.
08-31-2015, 12:58 PM
#9
Member
Registered: Feb 2013
Posts: 212
Original Poster
Rep:
Hi Michael,
So you are telling i have not added swap and root partition in fstab file? and none sunrpc isnot need in fstab Right?
08-31-2015, 01:08 PM
#10
Moderator
Registered: Aug 2002
Posts: 25,699
Yes, what you posted for your root partition is not correct.
Code:
LABEL=/ / ext3 rw 0 0
09-08-2015, 05:34 AM
#11
Member
Registered: Feb 2013
Posts: 212
Original Poster
Rep:
Hi Michaelk,
One my server shows blkid like below
/dev/sr0: LABEL="RHEL/5.7 x86_64 DVD" TYPE="iso9660"
/dev/sda3: LABEL="/share1" UUID="c991154f-fa69-4340-914f-3e114950a136" TYPE="ext3"
/dev/sda2: LABEL="SWAP-sda2" TYPE="swap"
/dev/sda1: LABEL="/1" UUID="542a5bd7-3057-43c4-96a7-668f2d34c6c2" TYPE="ext3"
For above blkid i need to write /etc/fstab for root like below?
LABEL=/1 / ext3 rw 0 0
why it is showing like /1?
Also boot partition not showing why in blkid output?
Last edited by sagar666; 09-08-2015 at 05:40 AM .
Reason: Also boot partition not showing why in blkid output?
09-08-2015, 08:51 AM
#12
Moderator
Registered: Aug 2002
Posts: 25,699
Tell us what you did?
It appears that you reinstalled along side the original. You can't have multiple partitions with the same label so the installer adds a 1. And during the install process you did not select a boot partition.
09-08-2015, 09:11 AM
#13
Member
Registered: Feb 2013
Posts: 212
Original Poster
Rep:
Hi Michaelk,
As i said earlier i overwrite the fstab entry in almost 50 server. Today i tried correct fstab entry as you suggested earlier but when do blkid its showing like below and i wondered why boot file system not showing when i do blkid
/dev/sr0: LABEL="RHEL/5.7 x86_64 DVD" TYPE="iso9660"
/dev/sda3: LABEL="/share1" UUID="c991154f-fa69-4340-914f-3e114950a136" TYPE="ext3"
/dev/sda2: LABEL="SWAP-sda2" TYPE="swap"
/dev/sda1: LABEL="/1" UUID="542a5bd7-3057-43c4-96a7-668f2d34c6c2" TYPE="ext3"
I have not reinstalled any thing and same behavior in few more machines.
09-08-2015, 09:20 AM
#14
Moderator
Registered: Aug 2002
Posts: 25,699
Sorry you did mention 50 servers. About all I can say is the installations are not identical and these servers do not have a separate boot partition.
09-08-2015, 09:42 AM
#15
Member
Registered: Feb 2013
Posts: 212
Original Poster
Rep:
So without boot partition system will boot? I guess root and boot partition are mandatory Right?
All times are GMT -5. The time now is 05:48 AM .
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know .
Latest Threads
LQ News