Go Job Hunting at the LQ Job Marketplace
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


Search this Thread
Old 03-06-2013, 02:08 AM   #1
LQ Newbie
Registered: Mar 2013
Posts: 2

Rep: Reputation: Disabled
I have a corrupted CF drive which will no longer mount

I am wanting to try and repair this drive if possible
I would also like to be able to take a complete image of this disk with an equivalent or better program like alcohol 120% as the program is protected by the supplier but when this drive crashed the only option for the client was to buy a new replacement unit with all the software which they had already paid for

I have installed Ubuntu 12.10 onto my laptop to try and fix the drive

When I try to mount the drive I get the following message

Error mounting /dev/sdb2 at /media/brent/_: Command-line `mount -t "ext3" -o "uhelper=udisks2,nodev,nosuid" "/dev/sdb2" "/media/brent/_"' exited with non-zero exit status 32: mount: wrong fs type, bad option, bad superblock on /dev/sdb2,missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so

@ubuntu:~$ sudo dmesg | tail
[ 2191.247579] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 2191.247582] sd 6:0:0:0: >[sdb]
[ 2191.247584] Sense Key : Hardware Error [current]
[ 2191.247590] sd 6:0:0:0: >[sdb]
[ 2191.247594] Add. Sense: Data phase error
[ 2191.247598] sd 6:0:0:0: >[sdb] CDB:
[ 2191.247600] Write(10): 2a 00 00 00 80 07 00 00 02 00
[ 2191.247612] end_request: I/O error, dev sdb, sector 32775
[ 2191.247617] Buffer I/O error on device sdb1, logical block 16387
[ 2191.247620] lost page write due to I/O error on sdb1

The drive appears to have 2 partitions
Partition 1 SYSDEF EXT2(version 1.0)
Partition 2 / EXT3(version 1.0)

I have tried the following from one of the posts
brent@ubuntu:~$ sudo mke2fs -n /dev/sdb2
[sudo] password for brent:
mke2fs 1.42.5 (29-Jul-2012)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
118080 inodes, 471909 blocks
23595 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=486539264
15 block groups
32768 blocks per group, 32768 fragments per group
7872 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912

sudo e2fsck -y -b 32768 /dev/sdb2

I have no idea what variant of Linux this drive is running

There may even be a disk utility in Linux, of which I am a dummy, which can scan and repair the drive

Any help would be much appreciated

Old 03-06-2013, 02:56 AM   #2
Registered: Sep 2010
Distribution: Fedora, Android, CentOS
Posts: 91
Blog Entries: 2

Rep: Reputation: 21
I would use GNU ddrescue to clone the drive to an image.
To install ddrescue
$ sudo apt-get update && apt-get install gddrescue
Basic launch command (with the device unmounted)
$ sudo ddrescue -r 3 /dev/sdb ./recovery.dd ./recovery.log
(-r 3 is three retries, /dev/sdb is the path to the block device for the CF card, recovery.dd is the image file to be created and recovery.log is the log file)

The image file will be the same size as the CF card. This creates a log file, if the CF card goes offline it can be disconnected, reconnected and the above command can be run to relaunch the recovery at the next block.

If everything is successful you can mount the the image's partitions as loop devices or use dd to write the image to another CF card.

I/O errors generally mean the CF card needs to be replaced.

Hope this gets you started.
Old 03-06-2013, 03:51 PM   #3
Registered: Mar 2008
Posts: 11,323

Rep: Reputation: 1386Reputation: 1386Reputation: 1386Reputation: 1386Reputation: 1386Reputation: 1386Reputation: 1386Reputation: 1386Reputation: 1386Reputation: 1386
Some of the makers of these flash devices offer their own tools to assist you. Try them maybe.

I might be tempted to try testdisk also.
Old 04-25-2013, 12:08 AM   #4
LQ Newbie
Registered: Mar 2013
Posts: 2

Original Poster
Rep: Reputation: Disabled
Thanks for all your help
Drive was completetly dead
I have been able to get a loan of another drive and was wondering what the command line is for ddrescue to recreate a drive from the image created or even just to do a complete copy of CF A to CF B
Old 04-29-2013, 04:52 PM   #5
Registered: Sep 2010
Distribution: Fedora, Android, CentOS
Posts: 91
Blog Entries: 2

Rep: Reputation: 21
So to dd the image back to the new CF card you can just use something like
# dd if=<path to image file> of=<path to cf card block device>
This will write the image back to the cf card. DDrescue is great for retrieving data from a failing device but unnecessary when writing it back from a good source.
Old 04-29-2013, 05:04 PM   #6
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,517
Blog Entries: 2

Rep: Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018Reputation: 4018
I have to ask this: You do want to make a copy of a copyrighted work and distribute it to your customer?

Please clarify that, since that would be against the LQ Rules and, depending on your country and the license of the product, may even be illegal in your jurisdiction, so it can get you into serious problems.


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
can't mount drive - corrupted superblock? WindowBreaker Slackware 7 02-17-2008 04:43 AM
NTFS won't mount, corrupted? greeklegend Linux - Desktop 4 08-18-2006 11:31 PM
sata drive no longer mounting automatically (but will mount manually) henno Slackware 1 05-20-2006 09:01 AM
No longer able to mount digicam fannymites Suse/Novell 8 02-18-2006 10:05 AM
Mount Corrupted NTFS Partition Under Linux omega71122 Linux - General 3 05-22-2005 08:55 PM

All times are GMT -5. The time now is 05:24 AM.

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