LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 12-01-2010, 04:10 AM   #1
kayod_jj
LQ Newbie
 
Registered: Dec 2010
Posts: 2

Rep: Reputation: 0
Emergency mode can mount the HDD with FS error but not in rescue or single user-mode


Hello everyone,

My linux workstation recently crashed. After rebooting, Linux (Red Hat 5.3) will not boot properly and automatically went into emergency mode or recovery mode i think. I can still see my /home/user/ and all the files inside.

I boot from CD to rescue mode and tried mounting read-only the /dev/sd5 which contains the files in the crashed hard disk to try to copy out my files but mounting was unsuccessful (invalid argument). I checked the filesystem type using fsck -N /dev/sda5 and shows it to ext2. i tried to mount another known working hdd and was successful.

My question is why in emergency mode, the crashed hdd is able to be mounted automatically as read-only but cannot be done in rescue mode thru a bootable CD?
Is there any special mount options used in emergency mode?

I also cannot copy out in emergency mode booting from the crashed hard disk as everything is read only.

Thanks,
JJ
 
Old 12-01-2010, 06:36 AM   #2
stress_junkie
Senior Member
 
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 331Reputation: 331Reputation: 331Reputation: 331
Use fsck to perform a repair on the partition.
Code:
fsck /dev/sda5
 
1 members found this post helpful.
Old 12-01-2010, 09:40 AM   #3
malekmustaq
Senior Member
 
Registered: Dec 2008
Location: /root
Distribution: Slackware & BSD
Posts: 1,206

Rep: Reputation: 230Reputation: 230Reputation: 230
Quote:
My question is why in emergency mode, the crashed hdd is able to be mounted automatically as read-only but cannot be done in rescue mode thru a bootable CD?
Because this time it is not mounted as read only.

Quote:
I also cannot copy out in emergency mode booting from the crashed hard disk as everything is read only.
The hdd needs to be checked. Run fsck /dev/sda5 as 'stress_junkie' suggested above. That is, without the -a and -p switch running as root. fsck will prompt you to remove some nodes, you may press 'y' to correct the errors.

Hope this helps. Goodluck.
 
2 members found this post helpful.
Old 12-01-2010, 07:03 PM   #4
kayod_jj
LQ Newbie
 
Registered: Dec 2010
Posts: 2

Original Poster
Rep: Reputation: 0
Thanks malekmustaq and stress_junkie.
Now I got clear path to proceed with try to rescue my data.

Found similar suggestion on the net. Hope it can help others as well.

Repairing Linux ext2 or ext3 file system
by LinuxTitli 16 comments

1) File system must be unmounted, you cannot repair it while it is running. Take system down to runlevel one (make sure you run all command as root user):
# init 1

2)Unmount file system, for example if it is /home (/dev/sda3) file system then type command:
# umount /home
OR
# umount /dev/sda3

3) Now run fsck on the partition:
# fsck /dev/sda3

However be sure to specify the file system type using -t option. Recenly one of our sys admin run the command on ext3 file system w/o specifying file system. Result was more corruption as fsck by default assumes ext2 file system.
# fsck -t ext3 /dev/sda3
OR
# fsck.ext3 /dev/sda3

Tip if you don't know your file system type then typing mount command will display file system type.

fsck will check the file system and ask which problems should be fixed or corrected. If you don't wanna type y every time then you can use pass -y option to fsck.
# fsck -y /dev/sda3

Please not if any files are recovered then they are placed in /home/lost+found directory by fsck command.

4) Once fsck finished, remount the file system:
# mount /home

5) Go to multiuser mode
# init 3
 
  


Reply


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
unique problem in resetting root password in suse linux in single user mode & rescue amit_kalipur Linux - Security 1 07-14-2009 01:41 PM
single user mode under vxfs mode enabled. UltraSoul Solaris / OpenSolaris 1 06-27-2009 09:48 PM
mount doesn't work in single user mode Dominik *BSD 3 02-10-2004 03:14 AM
mount errors on single user mode hopbalt Solaris / OpenSolaris 1 08-06-2003 05:10 PM
RH9 - Rescue, single, and emergency mode? blackx Linux - Newbie 3 05-22-2003 02:03 PM


All times are GMT -5. The time now is 11:35 PM.

Main Menu
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