LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 09-22-2009, 03:50 PM   #16
j_jerry
Member
 
Registered: Sep 2009
Distribution: fedora 11
Posts: 318

Rep: Reputation: 46

Quote:
Originally Posted by miteshpant View Post
still
warning : can't open /etc/fstab : No such file or directory
mount: can't find / in /etc/fstab or /etc/mtab
coz you have no /etc/fstab

can you login to X ?
 
Old 09-22-2009, 04:00 PM   #17
lwasserm
Member
 
Registered: Mar 2008
Location: Baltimore Md
Distribution: ubuntu
Posts: 184

Rep: Reputation: 41
The warning message is telling you in a roundabout way what the problem is. Since you have no fstab, you need to specify both the device and the mountpoint in your mount command. If your root partition is /dev/sda3, then use :

mount -o remount,rw /dev/sda3 /

Last edited by lwasserm; 09-22-2009 at 04:01 PM.
 
Old 09-22-2009, 04:04 PM   #18
ak@shdubey
LQ Newbie
 
Registered: Sep 2009
Location: India
Distribution: Redhat/Oracle Ent/CentOS
Posts: 28
Blog Entries: 1

Rep: Reputation: 16
Quote:
Originally Posted by miteshpant View Post
hi ,

I have deleted /etc/fstab file in RHEL5
tried to boot the system in single user mode and emergency mode
unable to edit the file and the file is missing , cannot create it, as i am loggged in as read only mode ,

tried to run mount -o remount,rw /dev/sda
but issue is not resolved
please suggest
Hi mitesh,

Please login as 'root' in single user mode & issue following commands,

#cat /proc/mounts > /etc/fstab
#chmod 644 /etc/fstab

this shall help

goodluck
-Akash
 
Old 09-22-2009, 04:08 PM   #19
miteshpant
LQ Newbie
 
Registered: May 2009
Posts: 24

Original Poster
Rep: Reputation: 0
i have already tried
mount -o -n remount,rw /dev/sda3 /
and
mount -o remount,rw /dev/sda3 /

i am getting the same error

i had already tried the steps mentioned before posting this
 
Old 09-22-2009, 04:57 PM   #20
btncix
Member
 
Registered: Aug 2009
Location: NC, USA
Distribution: Slackware x86
Posts: 141

Rep: Reputation: 26
First write down and save the output information to the following commands

1. #fdisk -l
2. #mount
3. #cat /proc/mounts


I don't know why you can't mount your partitions, but what should work is using a live cd. You can reboot with a "live cd", mount /dev/sda3, and then create /etc/fstab manually on /dev/sda3.

If you don't know what to write in your /etc/fstab, I suggest you provide the output of the 3 commands listed above.
 
Old 09-22-2009, 05:03 PM   #21
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Squeeze 2.6.32.9 SMP AMD64
Posts: 3,245

Rep: Reputation: 121Reputation: 121
Edited:
Never mind. Too many cooks for this pot as it is. Good luck.

Last edited by Quakeboy02; 09-22-2009 at 05:04 PM.
 
Old 09-22-2009, 05:12 PM   #22
ak@shdubey
LQ Newbie
 
Registered: Sep 2009
Location: India
Distribution: Redhat/Oracle Ent/CentOS
Posts: 28
Blog Entries: 1

Rep: Reputation: 16
Can you please post exact error printscreen/screenshot?

Quote:
Originally Posted by miteshpant View Post
i have already tried
mount -o -n remount,rw /dev/sda3 /
and
mount -o remount,rw /dev/sda3 /

i am getting the same error

i had already tried the steps mentioned before posting this
Can you please post exact error printscreen/screenshot?


If you are logged in as root than given below commands will let you create fstab file for sure
#cat /proc/mounts > /etc/fstab
#chmod 644 /etc/fstab

P.S: to check if you are root you can type #who or #whoami


I am sure this issue will be resolved, this forum is full of techs/geeks

-Akash
 
Old 09-22-2009, 05:26 PM   #23
JamesChamberlain
Member
 
Registered: Sep 2009
Location: Wirral, UK
Distribution: Red Hat Enterprise Linux / Fedora 11
Posts: 47

Rep: Reputation: 18
mount -n -o remount -t ext3 /dev/**yourpartition** /
 
Old 09-22-2009, 07:04 PM   #24
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.6, Centos 5.10
Posts: 16,324

Rep: Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041
You can do the rescue from the original install media (DVD/CD). At the very first text prompt, enter

linux rescue


http://www.linuxtopia.org/online_boo...mode-boot.htmlx

Last edited by chrism01; 09-23-2009 at 06:44 PM. Reason: test -> text
 
Old 09-23-2009, 08:37 AM   #25
miteshpant
LQ Newbie
 
Registered: May 2009
Posts: 24

Original Poster
Rep: Reputation: 0
i was just wondering if i can use th econtents of /boot partition , to load the os ..
this was i can enter read write mode
using the small linux , can anyone help me booting my system using small linux.
 
Old 09-23-2009, 06:39 PM   #26
miteshpant
LQ Newbie
 
Registered: May 2009
Posts: 24

Original Poster
Rep: Reputation: 0
hey every one
i got the solution without using the cd . thsi is what i did
1. logged in emergency mode
2.mount /dev/sda2 /boot
3.cd /dev
4.mkdir tmp
5.cp /boot/initrd(xyz).img /dev/tmp/.
6.cd /tmp
7.mkdir tmp2
8.gunzip -v -S .img /dev/tmp/initrd(xyz).img // THIS WILL UNZIP THE FILE
9.cd tmp2
10.cpoi -id < ..initrd(xyz) // THIS WILL EXTRACT THE INITRD FILE
11. make the fstab in etc directory thus extracted here
12. edit the init file to mount the / partion and the swap partition
13. find . | cpoi --create --format='newc' > /dev/tmp/newinitrd
14. gzip newinitrd // this will create neinitrd.gz
15. cd ..
16. mv newinitrd.gz initrd(xyz).img
17. cp /dev/tmp/initrd(xyz).img /boot/initrd(xyz).img
18. reboot the system
19. work as you want
 
Old 09-23-2009, 06:39 PM   #27
miteshpant
LQ Newbie
 
Registered: May 2009
Posts: 24

Original Poster
Rep: Reputation: 0
hey every one
i got the solution without using the cd . thsi is what i did
1. logged in emergency mode
2.mount /dev/sda2 /boot
3.cd /dev
4.mkdir tmp
5.cp /boot/initrd(xyz).img /dev/tmp/.
6.cd /tmp
7.mkdir tmp2
8.gunzip -v -S .img /dev/tmp/initrd(xyz).img // THIS WILL UNZIP THE FILE
9.cd tmp2
10.cpoi -id < ..initrd(xyz) // THIS WILL EXTRACT THE INITRD FILE
11. make the fstab in etc directory thus extracted here
12. edit the init file to mount the / partion and the swap partition
13. find . | cpoi --create --format='newc' > /dev/tmp/newinitrd
14. gzip newinitrd // this will create neinitrd.gz
15. cd ..
16. mv newinitrd.gz initrd(xyz).img
17. cp /dev/tmp/initrd(xyz).img /boot/initrd(xyz).img
18. reboot the system
19. work as you want
 
Old 09-22-2010, 08:19 AM   #28
hillolnayak
LQ Newbie
 
Registered: Aug 2010
Posts: 2

Rep: Reputation: 0
Recover /etc/fstab file

Recover /etc/fstab file
If you have deleted the /etc/fstab file it is possible to recover it in the following way:

cat /proc/mounts > /etc/fstab
chmod 644 /etc/fstab

The "proc" filesystem, which is /proc/mounts, is used to handle sytem configuration parameters, it is a virtual filesystem.


Hillol Nayak
Durgapur

Last edited by hillolnayak; 09-22-2010 at 08:21 AM.
 
Old 09-22-2010, 10:05 AM   #29
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
@hillolnayak

That was already mentioned in post #18 and did not seem to work. So why kick a thread that's a year old
 
Old 09-24-2010, 09:32 AM   #30
miteshpant
LQ Newbie
 
Registered: May 2009
Posts: 24

Original Poster
Rep: Reputation: 0
Hi Every one good to see it is still going on, But i guess you did not see the solution i posted.

1. logged in emergency mode
2.mount /dev/sda2 /boot
3.cd /dev
4.mkdir tmp
5.cp /boot/initrd(xyz).img /dev/tmp/.
6.cd /tmp
7.mkdir tmp2
8.gunzip -v -S .img /dev/tmp/initrd(xyz).img // THIS WILL UNZIP THE FILE
9.cd tmp2
10.cpoi -id < ..initrd(xyz) // THIS WILL EXTRACT THE INITRD FILE
11. make the fstab in etc directory thus extracted here
12. edit the init file to mount the / partion and the swap partition
13. find . | cpoi --create --format='newc' > /dev/tmp/newinitrd
14. gzip newinitrd // this will create neinitrd.gz
15. cd ..
16. mv newinitrd.gz initrd(xyz).img
17. cp /dev/tmp/initrd(xyz).img /boot/initrd(xyz).img
18. reboot the system
19. work as you want
 
  


Reply

Tags
help


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to recover deleted folder 124vikas.dange@gmail.com Linux - Software 1 09-09-2009 08:21 AM
How do I recover a rm deleted folder? CrownAmbassador Linux - Desktop 13 02-16-2009 04:54 AM
I have deleted rc.d from /etc. How can I recover it? rupeshukla Linux - Newbie 5 07-01-2008 05:21 AM
Recover deleted files? subaruwrx Linux - Newbie 8 06-04-2004 09:47 AM
Recover deleted files markdw Linux - General 1 12-07-2001 05:08 PM


All times are GMT -5. The time now is 04:03 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration