TestDisk: Flash Drive="CHS and LBA don't match" [SOLVED]

Using applications, configuring, problems
Message
Author
User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#76 Post by Karl Godt »

is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>

# e2fsck -b 8193 /dev/sdb1
e2fsck 1.41.14 (22-Dec-2010)
e2fsck: Bad magic number in super-block while trying to open /dev/sdb1
-b 8193 is from 1,44MB floppy disk drives times. If mkfs.ext2-4 is called without any inode or block or superblock parameters, the first backup of the superblock is written to -b 32768.

To determine the backup superblocks you can use

Code: Select all

dumpe2fs /dev/sdaX | grep -i backup
I get for example :
bash-3.00# dumpe2fs /dev/sda2 | grep -i backup
dumpe2fs 1.41.11 (14-Mar-2010)
Journal backup: inode blocks
Backup superblock at 32768, Group descriptors at 32769-32771
Backup superblock at 98304, Group descriptors at 98305-98307
Backup superblock at 163840, Group descriptors at 163841-163843
Backup superblock at 229376, Group descriptors at 229377-229379
Backup superblock at 294912, Group descriptors at 294913-294915
Backup superblock at 819200, Group descriptors at 819201-819203
Backup superblock at 884736, Group descriptors at 884737-884739
Backup superblock at 1605632, Group descriptors at 1605633-1605635
Backup superblock at 2654208, Group descriptors at 2654209-2654211
Backup superblock at 4096000, Group descriptors at 4096001-4096003
Backup superblock at 7962624, Group descriptors at 7962625-7962627
Backup superblock at 11239424, Group descriptors at 11239425-11239427

man mke2fs :
-S Write superblock and group descriptors only. This is useful if
all of the superblock and backup superblocks are corrupted, and
a last-ditch recovery method is desired
. It causes mke2fs to
reinitialize the superblock and group descriptors, while not
touching the inode table and the block and inode bitmaps. The
e2fsck program should be run immediately after this option is
used, and there is no guarantee that any data will be salvage-
able. It is critical to specify the correct filesystem block-
size when using this option, or there is no chance of recovery.
«Give me GUI or Death» -- I give you [[Xx]term[inal]] [[Cc]on[s][ole]] .
Macpup user since 2010 on full installations.
People who want problems with Puppy boot frugal :P

Sylvander
Posts: 4416
Joined: Mon 15 Dec 2008, 11:06
Location: West Lothian, Scotland, UK

#77 Post by Sylvander »

I have little to no understanding of all of this stuff.

Could you give explicit instructions as to what I aught to do?
And explanations needed to give me essential understanding needed to get it right?

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#78 Post by amigo »

I'm still wondering if you ever really formatted the drive or only set the partition type?

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#79 Post by Karl Godt »

Sylvander wrote:I have little to no understanding of all of this stuff.

Could you give explicit instructions as to what I aught to do?
And explanations needed to give me essential understanding needed to get it right?
I would like to introduce you to the man command:
man <command>
ie

Code: Select all

man mke2fs
In Puppy while connected to the internet, man should run the pman script to show you a manual page of the desired <command>. I personally had not used the -S option to mke2fs. mkfs.extX is usually a link to the mke2fs binary, like many commands are linked to busybox.
But it might be that you have a devx loaded that contains the real man binary. If you have no manpages installed by copying them from some bigger distros to your Puppy /usr/share/man folder, it would not show much.

Sylvander
Posts: 4416
Joined: Mon 15 Dec 2008, 11:06
Location: West Lothian, Scotland, UK

#80 Post by Sylvander »

amigo:
1. "I'm still wondering if you ever really formatted the drive or only set the partition type?"
Originally, the drive was partitioned...
Then that partition formatted as EXT3...
Then the formatting changed to FAT32...
Then it all went bad when I tried to copy some files to the partition.
You'll see [almost all] of the rest of my actions reported in this thread.
My head is in a spin, and I don't really understand all of the things I've been instructed to do, and then done.

Karl Godt:
2. I entered the command:

Code: Select all

man mke2fs
And got the display of information.
I can only hope this will help me better understand its use.

3. Tried entering:

Code: Select all

dumpe2fs /dev/sdb1 | grep -i backup
...and got:

Code: Select all

dumpe2fs /dev/sdb1 | grep -i backup 
dumpe2fs 1.41.14 (22-Dec-2010)
dumpe2fs: Bad magic number in super-block while trying to open /dev/sdb1
# 
...which is nothing like the output you got.
Am I doing something wrong?
I don't know how it would open sdb1, since that [partition] doesn't exist [according to GParted and other programs].

4. "It is critical to specify the correct filesystem block-
size when using this option, or there is no chance of recovery.
"
Sounds DANGEROUS...
Especially when I don't understand the use of the command.
You'd need to lead me by the hand, explaining each step in detail.

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#81 Post by Karl Godt »

*e2fs commands like tune2fs, mke2fs and dumpe2fs are only working for ext2-4 formatted partitions.

Since you already changed that in fdisk or formatted in gparted to some fat* , *e2fs progs won't work somehow. Probably there would come a multicall binary one day, like kmod or busybox managing most filesystems, probably when WindowsOS start to use a new filesystem, giving fat and ntfs to open source.

Sylvander
Posts: 4416
Joined: Mon 15 Dec 2008, 11:06
Location: West Lothian, Scotland, UK

#82 Post by Sylvander »

The drive partitioning->formatting seems to be corrupted in some way such that it is either:
1. Not recognized as one or the other...
Because it's neither completely one or the other.
Or...
2. Both sets of formatting are seen and are conflicting.

It's all beyond my understanding. :?
I tried using a program->command that would work with EXT3...
And then used a prog->command that works with FAT32...
And neither succeeded.

User avatar
ETP
Posts: 1193
Joined: Tue 19 Oct 2010, 19:55
Location: UK

Rabid Stick

#83 Post by ETP »

Hi Sylvander,

Could you please humour me & try my suggestion.

http://www.murga-linux.com/puppy/viewto ... 544#689544

p.s. I sent you a PM as you had marked the thread as solved but then continued to post. :)
Regards ETP
[url=http://tinyurl.com/pxzq8o9][img]https://s17.postimg.cc/tl19y14y7/You_Tube_signature80px.png[/img][/url]
[url=http://tinyurl.com/kennels2/]Kennels[/url]

Sylvander
Posts: 4416
Joined: Mon 15 Dec 2008, 11:06
Location: West Lothian, Scotland, UK

#84 Post by Sylvander »

Typing from FalconFour's UBCD->MiniXP...
[All I have that resembles an XP OS]
Previously:

1. Downloaded [within Slacko-5.3.3.1] the files:
16Meg5493.img
win32diskmanager-v0.7-binary.zip

To a folder in my FAT32 partition sda2->[now E: in MiniXP].
Unzipped the zip file, and got all of the enclosed files, including the Win32DiskImager.exe file.

2. Rebooted using the FalconFour's UBCD, chose the MiniXP OS.

3. Once in there, used Windows Explorer to navigate to the Win32DiskImager.exe file, right-clicked it and chose to Open.
The following warning was displayed:
File Error:
...while querying the properties.
This usually means something is currently accessing the device; please close all applications and try again.
Error 1: Incorrect function.

Clicked OK, and the warning window closed, and the program window was properly displayed.

4. Used the navigation icon to choose the image img file.
The full path and file name was correctly displayed in the window.
I clicked the WRITE button to write data in image file to device.
Got warning asking if I was sure.
Told it to proceed.

5. Got 2nd warning:
Write error:
...when attempting to write data
[img file] to handle.
Error 19: The media is write protected.


6. What now?

User avatar
ETP
Posts: 1193
Joined: Tue 19 Oct 2010, 19:55
Location: UK

Rabid Stick

#85 Post by ETP »

Hi Sylvander,

Any Windows OS should suffice but the imager does need to be run from the hard drive.

Note what step2 requires:


[quote]1. Delete all partitions on your target device.

2. Unplug any sticks or cards other than your target device.

3. In XP use Win32diskimager to write the image to the target.

Stop after writing the image (step 3) and attempt to boot from it on your own PC.
If it boots to a menu stop the countdown then select “power off
Regards ETP
[url=http://tinyurl.com/pxzq8o9][img]https://s17.postimg.cc/tl19y14y7/You_Tube_signature80px.png[/img][/url]
[url=http://tinyurl.com/kennels2/]Kennels[/url]

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#86 Post by amigo »

So, the drive was partitioned and formatted with ext3 fs. Then the drive was reformatted as FAT -no mention about the partition type. Later drive was unmountable.

Let me say again:
1. Let the drive be unmounted before you start(I know it is unmountable at the moment)
2. If the drive is not partitioned or has the wrong partition type, then run fdisk or cfdisk and cretae the partition with type '83' for normal linux filesystems.
3. format the drive using mke2fs or mkfs.ext2:
mke2fs -F 32 /dev/sd(drive and partition number)

Now, it should be mountable. In the case of the OP, the current situation seems to be that number 1 and number 2 are already done. Please try number 3 again (if it was even done before) and then see if the drive is still unmountable.

Sylvander
Posts: 4416
Joined: Mon 15 Dec 2008, 11:06
Location: West Lothian, Scotland, UK

#87 Post by Sylvander »

Did the above [correctly?], and got this:

Code: Select all

# mke2fs -F 32 /dev/sdb1
mke2fs 1.41.14 (22-Dec-2010)
mke2fs: invalid blocks count '/dev/sdb1' on device '32'
# 
I'd tried step 2 again, and the partition type was Linux/83 in fdisk.
Then I wrote the changes, then tried step 3.

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#88 Post by amigo »

Oh wait, I was doing something else while I wrote that -you want an ext2 filesystem, right? Run this instead:
mkfs.ext2 /dev/sdb1
and then see if it mounts(if the command succeeds).

Sylvander
Posts: 4416
Joined: Mon 15 Dec 2008, 11:06
Location: West Lothian, Scotland, UK

#89 Post by Sylvander »

Here's what I get:

Code: Select all

# mkfs.ext2 /dev/sdb1
mke2fs 1.41.14 (22-Dec-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
61568 inodes, 246272 blocks
12313 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=255852544
8 block groups
32768 blocks per group, 32768 fragments per group
7696 inodes per group
Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376

Writing inode tables: done                            
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 34 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
# 
Is this good?

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#90 Post by Karl Godt »

Looks OK.

Now run

Code: Select all

e2fsck -b 32768 -v -f -c /dev/sdb1
OR

Code: Select all

e2fsck -b $((32768*4)) -v -f -c /dev/sdb1
in case e2fsck counts blocksizes of 1KiB while other e2fs-tools might count 4096Byte blocks .

Sylvander
Posts: 4416
Joined: Mon 15 Dec 2008, 11:06
Location: West Lothian, Scotland, UK

#91 Post by Sylvander »

1. 9:00 a.m.= Running the 1st command at present.
There is a HUUUUGE long list of problems detected on various inodes [7358 to 7558 at present].
I'm agreeing to fix each of them.
Been at it for 15 min so far.
Will keep clicking Y if my fingers hold out, and report back if/when the series completes all fixes.

2. 9:26 a.m.= Now at this stage:

Code: Select all

*** journal has been re-created - filesystem is now ext3 again ***
Restarting e2fsck from the beginning...
yye2fsck: Superblock invalid, trying backup blocks...
Superblock has an invalid journal (inode 8).
Clear<y>? yes

*** ext3 journal has been deleted - filesystem is now ext2 only ***

Resize inode not valid.  Recreate<y>? yes

badblocks: Input/output error during ext2fs_sync_device
Checking for bad blocks (read-only test): done                                
/dev/sdb1: Updating bad block inode.
Pass 1: Checking inodes, blocks, and sizes
Journal inode is not in use, but contains data.  Clear<y>? yes

Inode 7217 is in use, but has dtime set.  Fix<y>?
Notice I improperly hit Y twice before e2fsck [yye2fsck], but it appears it caused no problem.
Will continue...

3. 9:41a.m.=looks like it's just repeating the previous stage.
Finishes with this:

Code: Select all

Recreate journal<y>? yes

Creating journal (4096 blocks):  Done.

*** journal has been re-created - filesystem is now ext3 again ***
Restarting e2fsck from the beginning...
e2fsck: Bad magic number in super-block while trying to open /dev/sdb1

The superblock could not be read or does not describe a correct ext2
filesystem.  If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
    e2fsck -b 8193 <device>

e2fsck: io manager magic bad!
#  
3. 9:41a.m.=looks like it's just repeating the previous stage.

4. Second command gives this:

Code: Select all

# e2fsck -b $((32768*4)) -v -f -c /dev/sdb1
e2fsck 1.41.14 (22-Dec-2010)
e2fsck: Invalid argument while trying to open /dev/sdb1

The superblock could not be read or does not describe a correct ext2
filesystem.  If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
    e2fsck -b 8193 <device>

# 

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#92 Post by Karl Godt »

Seems that the Verbatim brand flash drive just decided to retire because of Osteoporosis .

You can of course, if being tired to hit y all the time, use the -p or -y option for fsck. Or the -n option first for getting an overview.

The second $((BLOCK*4)) might be helpful for the mount-FULL command then :

Code: Select all

mkdir -p /mnt/sdb1
mount-FULL -t ext2 -o sb=$((32768*4)) /dev/sdb1 /mnt/sdb1

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#93 Post by Karl Godt »

*** journal has been re-created - filesystem is now ext3 again ***
Dunno what i can say now : You made an ext2 fs on it and it claimed to have found ext3 journal somewhere. Watch out that there is no hidden .journal file somewhere on the flash. e2fsck would try to implement it.

npierce
Posts: 858
Joined: Tue 29 Dec 2009, 01:40

#94 Post by npierce »

Hi Sylvander,

if none of your recent experiments have produced a mountable filesystem on your flash drive, I have found one other thing that you might try.

First, just to verify that nothing has changed, try this one last time:

Code: Select all

fdisk -l /dev/sdb
If you still get the familiar:

Code: Select all

Disk /dev/sdb: 1010 MB, 1010826752 bytes
196 heads, 9 sectors/track, 1119 cylinders, total 1974271 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0009dcf9

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048     1972223      985088    b  W95 FAT32
showing that your partition is still type b (W95 FAT32), then your attempt on Wednesday to change it to type 83 (Linux) did not succeed, even though you did your best to write it to the drive. This means that your partition table is still unwritable, and no miraculous recovery has happened since we first established that it was unwritable at the beginning of last week.

(On the other hand, if by some miracle the partition type has changed, please report that, and ignore the remainder of this post.)

The write error that you got when you tried Win32DiskImager.exe is a further indication that the drive doesn't want to be written to.

So, I did some searching and found that some manufacturers provide utilities to fix a drive that is no longer writable. Unfortunately, I could not find such a utility on the Verbatim web site.

But I found an interesting post by someone who used a utility provided by another manufacturer to fix a Verbatim 1GB drive:
On 2008-May-11, at fixya.com, 'Guest' wrote:I solved write protection on my Verbatim store 'n' go 1 GB by this program "HT203 Handy Steno 2.0 Repair Tool" which format FLASH DISK from http://emea.apacer.com/en/support/downloads.asp . I know its different manufacturer but its working.
On that same page (http://www.fixya.com/support/t259854-tu ... rbatim_4gb) other people reported success with that utility, although they don't say if they had Verbatim drives.

The URL given by 'Guest' seems to be no longer valid, but I did track down what looks to be possibly a newer version of the same utility at this URL:

http://ap.apacer.com/support/download/r ... ,0,/page/4
Utility HT203 8 2.0 Repair Tool English WinME/2000/XP/Vista 139.72kb 2008/03/14
(If it no longer appears on that page (page 4), look on the other pages, or try a search from http://ap.apacer.com/support/download/.)

Clicking the symbol in the Download column will download a .zip file with this name: Repair_v2.9.1.1.zip

Note that this is not a Linux utility, it's for certain versions of Windows. I have no idea if it will work with "FalconFour's UBCD->MiniXP", which is apparently the closest thing you have to Windows. But it might.


Before you decide whether or not you want to try this utility, you should consider these three things:

1. I have had no experience with this utility, nor do I have a Verbatim drive (or even an Apacer drive) to test it on. All we know is that one person posted an answer to a question at fixya.com and claimed that the utility fixed a "Verbatim store 'n' go 1 GB" flash drive. That is a hopeful sign, but certainly no guarantee that it will work for you.

2. Apacer offers this utility for Apacer drives, not Verbatim drives. While it is very possible that the design of the Verbatim drive is similar to the design of the Apacer drive, and that the utility will work properly with a Verbatim drive, as reported by 'Guest', running a utility on a piece of hardware that the utility was not designed for is generally not a good idea, as it might even cause damage. While we hope that we can believe 'Guest', running this utility is something that should probably be done only when all other options have been exhausted, just in case 'Guest' is wrong, and the utility would damage your drive. (Of course, as it is now your drive is unusable, so unless you can find an official Verbatim utility there is probably nothing else you can do to fix this, so any further damage would not leave you any worse off than you are now.)

3. As I've said before, it is quite possible that your drive has physically died. In that case using the utility will obviously not help. (On the bright side, if it has died, using the utility wouldn't hurt, either. :) )


Anyway, this is something to try when you reach the end of your rope, and are on the verge of tossing the drive out of the window. (I probably would have reached that point long ago. :) You have more patience than I.)

And, despite all I said above about why this utility might not work, I still think that it might be your best bet. Unless you want to spend time on what might be a futile search for an official Verbatim utility, I can think of nothing else to try.

If it was my drive, I'd try mounting it one more time just to be sure none of your recent experiments helped. Then I'd try the utility.

But I can certainly understand if you choose not to.

Good luck.

Sylvander
Posts: 4416
Joined: Mon 15 Dec 2008, 11:06
Location: West Lothian, Scotland, UK

#95 Post by Sylvander »

npierce:
1. "partition is still type b (W95 FAT32)"
It is indeed still so.
I'm going to try running the [portable?] program [exe file] in "FalconFours UBCD->MiniXP", and report back on the result.
I have it downloaded [to a folder in a FAT32 partition=sda2 on my internal HDD], and exe extracted.
Wish me luck. :D

Karl Godt:
2. I'd have tried [and will try] your suggestion if/when I understand what it means, and what to actually do.
I was hoping to leave it to mature in my confused thoughts.
Any chance of more detailed explanation/instructions?

npierce:
3. Posting this from FalconFour's UBCD->MiniXP.
a. Used Windows Explorer to navigate to the portable program exe file, right-clicked and clicked Open.
Result = The program reports: USB Flash disk not found. :(

Post Reply