LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 12-17-2005, 08:38 PM   #1
juu801
LQ Newbie
 
Registered: Jul 2005
Posts: 23

Rep: Reputation: 15
HDD Hosed?


I recently moved. Before I moved everything seemed to be working just fine. I set all my computers up in the new house and everything worked for about an hour. I have a file server that runs Clarkconnect (Fedora based), well I had two actually. When setting them up my older server wouldn't post so I took the (music and video)drives out and added the PCI IDE card to the other machine and connected the drives. I was able to connect to the shares for a little while. After about an hour I couldn't connect to my music drive. The video drives still worked but no music. I checked /proc/partitions to make sure I was trying to mount the right one. The music drive showed 4 partitions when it should only have 1. I pulled the drive out an put it in my workstation. Booted into Mepis and ran QTParted. It said there was no partition table. After looking on the forums a little I found a suggestion to run gpart on the Knoppix. I tried it and it guessed 4 empty partitions. The drive in questions is a Western Digital 120GB 8MB Cache 7200rpm. It's formatted as ext3. Is this drive dead? Are the partitions unsalvagable? Should I reformat and start ripping again, or secure erase and toss the drive? Any suggestions are welcome. My collection had reached over 10,000 songs and I hadn't gotten around to burning 25% of it.
 
Old 12-17-2005, 09:31 PM   #2
Electro
LQ Guru
 
Registered: Jan 2002
Posts: 6,042

Rep: Reputation: Disabled
You can try to get a 160+ GB hard drive. Format the new drive and image the drive that you think failed using dd. The dd syntax that you should use is "dd if=failed drive of=image file to save to new drive bs=512 conv=noerrors,sync". Power down your computer after it is done with dd to disconnect the failed drive. Power up the compter and set the image file as a loop device and make a partition. You can run the utility grep to find a certain word like mp3 before making the image as a loop device. Next disconnect the loop device and reconnect it again. Then run fsck on the loop device partition. If you can mount it at some directory and you are able to play your media files, you can try to re-partition the failed drive and format it. Hopefully, the failed drive can come back to life and you use it as temporary storage.

Next time always make backups if you are going to move the computer. Also it is better that you move your computer to its destination.
 
Old 12-23-2005, 10:12 AM   #3
juu801
LQ Newbie
 
Registered: Jul 2005
Posts: 23

Original Poster
Rep: Reputation: 15
Ok I'm confused. I tried going through your directions and read through man pages and googled terms to help me along but I'm still unsure if I'm doing this right.
I got my new 250GB drive in the other day and hooked both the old and new up to my desktop. I formatted the new drive with reiserfs. I then issued the following command:
dd if=/dev/hdd of=/mnt/hdc/backup bs=512 conv=noerror,sync
Which returned a message that said that something was copied over.
After reading a little about loop devices I issued:
losetup /dev/hdc/backup /dev/loop0
Then I created a partition. (Which confuses me wouldn't these erase anything in the image file?)
mkfs.ext3 -v /dev/loop0
fsck returned no errors (I'm assuming that's because it was just formatted.)
I mounted the loop device with both:
mount -t ext3 /dev/loop0 /mnt/music
and
mount -o loop /dev/loop0 /mnt/music
Either way the only thing there is the lost+found folder. So, where am I messing up? Am I completely confused? Am I close? Thanks again for any help you can provide.
 
Old 12-23-2005, 04:46 PM   #4
Electro
LQ Guru
 
Registered: Jan 2002
Posts: 6,042

Rep: Reputation: Disabled
You mess up on formatting the device. Formatting will just erase data or files in the image. You have to again re-do the image process. Since you said earliar that the drive seems to show four partition, but you said that it should only have one. After re-imaging the old drive, run cfdisk on the loop device and delete all the partitions. You probably want to include the same cynlinders, heads, and sectors per track information as the old hard drive when running cfdisk on the image. Next add a primary partition. Use losetup to disconnect the loop device. Then use losetup to mount the image. Use fdisk -ul /dev/loop0 to find out the sector information. It should be the same as the old drive. You can then disconnect the loop and connect it again but with an offset option of 32256. You can then mount it on directory as read only to see if you can read any files. If you can not, you may need to run fsck on the loop device. The following link will tell you how I got the value 32256.

http://www.mega-tokyo.com/osfaq2/ind...ad2fb975636d0d

I have not done this a dozen times to understand it well.

Summarizing the steps:
1) Image the old drive to a file on the new drive.
2) Use losetup to setup the image file as a loop device.
3) Create a partition on the loop device with cynlinder, heads, sectors per track information of the old drive.
4) Disconnect the loop device.
5) Connect the image file as a loop device.
6) Run fdisk -lu /dev/loop to find out sector information to calculate offset for next steps.
7) Disconnect the loop device.
8) Connect the image file as a loop device but with an offset option set a certain byte (usually 32256).
9) Try mounting loop device as read-only at some directory.
10) If step nine fails, run fsck on the loop device.
11) If step ten fails, use old drive as a temporaly drive.
12) If step eleven fails, search for a computer component diposal company to get rid of it safely instead of throwing it in the garbage.
 
Old 12-23-2005, 11:01 PM   #5
juu801
LQ Newbie
 
Registered: Jul 2005
Posts: 23

Original Poster
Rep: Reputation: 15
Ok so I got the info from the old drive and specified the info when I ran cfdisk on the loop device. It shows a 120GB partition. I try to create a primary partition but it doesn't create it. It doesn't give any error it just shows that there is 120GB free, nothing changes. I tried saving even though it didn't look like it did anything and tried mounting it and there's nothing there except the lost+found folder. Before I deleted the partitions it showed that there was one partition but it was only approx 40GB.

If I run cfdisk on the old drive it shows 4 partitions. 1 primary and 3 empty. But, in fdisk it show 1 partition.


Should I interpret this as my music is gone and I need to start re-rpping? Am I still missing something?
 
  


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
Just Hosed my System sorceran Slackware 1 09-28-2004 12:59 PM
Completely hosed. kayhan Linux - Newbie 7 03-12-2003 12:23 PM
Am I hosed ? lostboy Linux - Hardware 14 03-10-2003 11:45 PM
Hosed once again Cichlid Linux - Hardware 3 11-02-2002 09:21 PM
hosed MBR lacrimae Linux - Software 11 07-27-2002 11:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 11:09 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
Open Source Consulting | Domain Registration