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 01-27-2012, 02:44 AM   #1
GNakul
Member
 
Registered: Oct 2011
Location: Bangalore,India
Posts: 59

Rep: Reputation: Disabled
hard_disk_issue


Hi all,
My 500gb harddisk is not booting. It has ubuntu 10.04 server. if i boot from live cd it is detecting the hard disk as 255MB file system. It is my office server and cannot afford to lose the data. How do i get my data back. Is the hard disk gone? Please help.

Thanks
-Nakul
 
Old 01-27-2012, 03:03 AM   #2
ukiuki
Senior Member
 
Registered: May 2010
Location: Planet Earth
Distribution: Debian
Posts: 1,030

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
With the liveCD you will be able to see what data is in the hard drive, about the 255MB one it is probably only one partition, there are more for sure. Also with the liveCD you can run the disk utility to check what is the disk conditions.

Regards

Last edited by ukiuki; 01-27-2012 at 03:40 AM. Reason: typo
 
Old 01-27-2012, 03:30 AM   #3
GNakul
Member
 
Registered: Oct 2011
Location: Bangalore,India
Posts: 59

Original Poster
Rep: Reputation: Disabled
@ukiuki:
Hi, thanks for reply.I found that other part of disk was lvm partition and vgscan worked out. I mounted those partition and was able to see my folders. 255mb is pprobably the /boot
But some folders are marked as bad and not able to view files inside those folders. Is it possible to recover those stuff.? Its too important for us.
 
Old 01-27-2012, 03:32 AM   #4
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
The first thing to do, before making any changes to the disk, is to make a copy of it to another disk using a Live CD/DVD and the dd command.

The next thing to do is to promise yourself that you will start making backups.
 
Old 01-27-2012, 03:47 AM   #5
ukiuki
Senior Member
 
Registered: May 2010
Location: Planet Earth
Distribution: Debian
Posts: 1,030

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
With the liveCD you can map an folder in another machine and copy the data. Or you can add a second harddrive to the machine and copy the data to the new harddrive, or yet with the liveCD you can write the data into CD/DVD, flash drives or any other type of storage devices you have available.

Regards
 
Old 01-27-2012, 03:57 AM   #6
GNakul
Member
 
Registered: Oct 2011
Location: Bangalore,India
Posts: 59

Original Poster
Rep: Reputation: Disabled
dd will replicate the partition table. I have lvm partitions on the crashed hdd. I just want my data. not the partion. And i am scared to do block level IO such as dd, since i had messed up previously and lost all data. Is there any other way??
And also will dd read the bad sectors??

Last edited by GNakul; 01-27-2012 at 04:00 AM.
 
Old 01-27-2012, 04:17 AM   #7
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
Quote:
Originally Posted by GNakul View Post
But some folders are marked as bad and not able to view files inside those folders. Is it possible to recover those stuff.? Its too important for us.
It id probably possible to recover at least some of the files but the attempt may further damage the data. That's why the first thing to do is make a copy of the whole disk (via its device file, not as a mounted file system) using dd. That way, you can start over on another copy with another data recovery utility.

I am not familiar with data recovery utilities but two or three have been mentioned in LQ threads and good results reported. Here's an LQ search including this thread.
 
Old 01-27-2012, 04:26 AM   #8
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
Quote:
Originally Posted by GNakul View Post
dd will replicate the partition table. I have lvm partitions on the crashed hdd. I just want my data. not the partion. And i am scared to do block level IO such as dd, since i had messed up previously and lost all data. Is there any other way??
And also will dd read the bad sectors??
Your data is in the partition, in a damaged file system on LVM volume(s) in partitions so, for maximum chance of recovery you need to image the partition. Working with file sytem level could cause further damage.

dd does not change its input file (in this case the whole disk or just the affected partition) so you can only mess up by giving the wrong output file. Presumably the LVM metadata is on a separate file system from the data (under /etc) so you might as well copy the entire disk. Ideally you would make two copies and try recovery on one of them, keeping the other to start over.

You should use conv=sync,noerror on the dd command line to get a coherent image if some blocks are unreadable.
 
Old 01-27-2012, 04:36 AM   #9
GNakul
Member
 
Registered: Oct 2011
Location: Bangalore,India
Posts: 59

Original Poster
Rep: Reputation: Disabled
@catkin: can you complete and give me this dd command with what you said
dd if=/dev/sda of=/dev/sdb
 
Old 01-27-2012, 04:48 AM   #10
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
Please make certain that /dev/sda is the failing disk and /dev/sdb is the disk to receive the copy. The sdb disk must be at least as big as sda.

The command I would use is:
Code:
dd if=/dev/sda of=/dev/sdb bs=4096 conv=notrunc,noerror
The bs (block size) should speed up the copy.

You can see how much data has been copied by
Code:
ps aux | awk '/bin\/dd/ && !/awk/ {print $2}' | xargs kill -s USR1 $1
The dd command will write a progress report on receipt of signal USR1.
 
Old 01-27-2012, 05:00 AM   #11
GNakul
Member
 
Registered: Oct 2011
Location: Bangalore,India
Posts: 59

Original Poster
Rep: Reputation: Disabled
@catkin: Thanks man. Will try it out.Hope dd exits succesfully.
 
  


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




All times are GMT -5. The time now is 08:16 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration