Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Wed 16 Apr 2014, 12:49
All times are UTC - 4
 Forum index » House Training » Users ( For the regulars )
TestDisk: Flash Drive="CHS and LBA don't match" [SOLVED]
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 3 of 11 [156 Posts]   Goto page: Previous 1, 2, 3, 4, 5, ..., 9, 10, 11 Next
Author Message
Semme

Joined: 07 Aug 2011
Posts: 3258
Location: World_Hub

PostPosted: Wed 27 Feb 2013, 14:38    Post subject:  

Amigo- well done. Hopefully this clarifies for Sylvander the partition *type* you spoke of in your opening post.
Back to top
View user's profile Send private message 
proebler

Joined: 24 Jan 2012
Posts: 64
Location: TAS

PostPosted: Wed 27 Feb 2013, 18:13    Post subject:  

Sylvander wrote:
Quote:
Tried to, but couldn't find anything named "disk utility" within the Mint environment.
Where is it located?
Does it come natively included, or would I need to install it?

Disk Utility is in Accessories [Mint Debian-xfce]
Back to top
View user's profile Send private message 
Sylvander

Joined: 15 Dec 2008
Posts: 3246
Location: West Lothian, Scotland, UK

PostPosted: Thu 28 Feb 2013, 05:18    Post subject:  

amigo:
1. Followed your instructions [correctly I hope], and got the following:
Any useful info there?
Code:
# mount -t vfat /dev/sdb1 /mnt/sdb1
mount: wrong fs type, bad option, bad superblock on /dev/sdb1,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

#

Before entering the above command I checked, and /mnt/sdb1 did in fact exist.
I had chosen to make partition type c=W95 FAT32 (LBA).
Hope this was the correct choice.

proebler:
Will now reboot into Mint, and look for Disk Utility.
Done: No Disk Utility in Accessories! Sad
Will make new Mint=Debian-xfce bootable DVD-RW, and try in there.
Got a link for the Debian-xfce iso file?
Back to top
View user's profile Send private message 
Semme

Joined: 07 Aug 2011
Posts: 3258
Location: World_Hub

PostPosted: Thu 28 Feb 2013, 06:31    Post subject:  

Sylvander- go ahead and fdisk your device again- we won't write to it.

Once up, type *p* to dump the partition table. What's the *Id* read?

To quit without write >> *q*

PS- You don't need Mint to zero your drive. Wink
Back to top
View user's profile Send private message 
Sylvander

Joined: 15 Dec 2008
Posts: 3246
Location: West Lothian, Scotland, UK

PostPosted: Thu 28 Feb 2013, 07:01    Post subject:  

Semme:
1.
Semme wrote:
Once up, type *p* to dump the partition table. What's the *Id* read?

Done.
Here's the result:
Code:
Command (m for help): p

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


2.
Semme wrote:
You don't need Mint to zero your drive.

Thanks, I'll try using these instructions to zero the drive.
Hmmm, how do I create the junk.bin file on sdb1 if I cannot mount sdb1?

proebler:
3.
proebler wrote:
Disk Utility is in Accessories...

In "linuxmint-xfce-201104-dvd-64bit", I found it in "System", but it failed to complete all the operations I tried [format drive, format partition, delete partition].
I'm certainly getting around. Very Happy
Back to top
View user's profile Send private message 
Semme

Joined: 07 Aug 2011
Posts: 3258
Location: World_Hub

PostPosted: Thu 28 Feb 2013, 07:08    Post subject:  

Hold up on that zero link. I recall there being a typo..

Not sure why, but your sector size looks odd. Hmm..

Ah, yes- it's the format me thinks..

Haven't seen Very Happy FAT in a while.

==

fdisk can alter cylinders, heads and sectors?

CoolIdea <rubs hands together> Hmm..

==

Ya know- how about an fsck?

Format switch ext2/3..

e2fsck *

Then back >> FAT32.

Just think'n..

==

Aha! You've got an old boot sector on this drive!

mount -t vfat >> bad superblock? I think NOT!
Back to top
View user's profile Send private message 
proebler

Joined: 24 Jan 2012
Posts: 64
Location: TAS

PostPosted: Thu 28 Feb 2013, 09:49    Post subject:  

sorry, but what is the problem?
I'm confused.
Does the device still not work?
The output from fdisk looks reasonable.
Code:
Command (m for help): p

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


This is an USB flash drive, not a HD.
Heads, sectors/track cylinders, are meaningless.

This is from one of my own USB's, it works, mounts and shows perfectly.
It is bootable, as indicated by the *, but that is no necessity.

Code:
Command (m for help): p

Disk /dev/sdb: 4083 MB, 4083351552 bytes
126 heads, 62 sectors/track, 1020 cylinders, total 7975296 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: 0x000139ca

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *        2048     3729407     1863680   83  Linux
/dev/sdb2         3729408     7450623     1860608   83  Linux
/dev/sdb3         7450624     7974911      262144    b  W95 FAT32



..or this, from a single partition 8 GB USB.
It too works and mounts correctly but Gparted cannot make sense of it. It is not bootable.

Code:
Command (m for help): p

Disk /dev/sdc: 8086 MB, 8086618112 bytes
249 heads, 62 sectors/track, 1023 cylinders, total 15794176 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: 0x2c6b7369

This doesn't look like a partition table
Probably you selected the wrong device.

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1   ?  1936028272  3787887330   925929529+  68  Unknown
/dev/sdc2   ?  1330184192  1869160479   269488144   79  Unknown
/dev/sdc3   ?   538989391  1937352302   699181456   53  OnTrack DM6 Aux3
/dev/sdc4   ?  1394627663  1394648999       10668+  49  Unknown

Partition table entries are not in disk order
Back to top
View user's profile Send private message 
Semme

Joined: 07 Aug 2011
Posts: 3258
Location: World_Hub

PostPosted: Thu 28 Feb 2013, 09:58    Post subject:  

There might be an easy way to check for corruption. When you're ready..
Back to top
View user's profile Send private message 
npierce

Joined: 28 Dec 2009
Posts: 854

PostPosted: Thu 28 Feb 2013, 10:01    Post subject:  

Since you got had the "CHS and LBA don't match" error message, it could be helpful to see the raw partition table. This can be done as follows:

First, just to be sure that your Puppy can still find your flash drive as /dev/sdb, and to be sure nothing has changed, enter this command:
Code:
fdisk -l /dev/sdb

If you still get "Disk /dev/sdb: 1010 MB, 1010826752 bytes . . .", enter this command line:
Code:
dd if=/dev/sdb bs=1 skip=446 count=64 2>/dev/null | hexdump -C

As you are probably aware, it is always good to know what you are doing with the dd command, since a typo can be a dangerous thing. So I'll explain what that line does.

The partition table is 64 bytes in length and lives 446 bytes from the beginning of your drive.

if=/dev/sdb means dd will take its input from /dev/sdb, currently your flash drive.

bs=1 means dd will work in units of one-byte blocks.

skip=446 means dd will skip the first 446 units of input.

count=64 means dd will copy the next 64 units.

2>/dev/null suppresses the status message from dd.

| hexdump -C pipes the output from dd to hexdump, which displays the byte values.

(This command doesn't write to your flash drive, it only reads from it.)

This should display four lines of sixteen bytes each. These are the four entries in the partition table. Please post that output as well as the output from the above "fdisk -l /dev/sdb" command.
Back to top
View user's profile Send private message 
amigo

Joined: 02 Apr 2007
Posts: 2165

PostPosted: Thu 28 Feb 2013, 11:22    Post subject:  

What's the output from these commands?
`cat /proc/filesystems`
and:
`lsmod`
Back to top
View user's profile Send private message 
Semme

Joined: 07 Aug 2011
Posts: 3258
Location: World_Hub

PostPosted: Thu 28 Feb 2013, 11:40    Post subject:  

Sylvander, it's a PILEUP! Very Happy Cuz, weez'ALL *really* wantcha ta have photos on dat dare flash drive'a yers.. LaughingWink
sylvander_datchoo-down-dare.jpg
 Description   
 Filesize   115.47 KB
 Viewed   428 Time(s)

sylvander_datchoo-down-dare.jpg

Back to top
View user's profile Send private message 
Sylvander

Joined: 15 Dec 2008
Posts: 3246
Location: West Lothian, Scotland, UK

PostPosted: Fri 01 Mar 2013, 05:12    Post subject:  

proebler:
1. "Does the device still not work?"
Correct.

2. "what is the problem?"
It won't do anything I'd expect a Flash Drive to do.
e.g. Won't mount; can't do anything with it in most programs like GParted.

npierce:
3. "If you still get "Disk /dev/sdb: 1010 MB, 1010826752 bytes . . .""
Yes got that. Very Happy
Here's the output:
Code:
# fdisk -l /dev/sdb

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
#


4. Next tried:
Code:
dd if=/dev/sdb bs=1 skip=446 count=64 2>/dev/null | hexdump -C

And got:
Code:
# dd if=/dev/sdb bs=1 skip=446 count=64 2>/dev/null | hexdump -C
00000000  00 20 21 00 0b c3 09 7a  00 08 00 00 00 10 1e 00  |. !....z........|
00000010  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
00000040
#


amigo:
5.
Code:
# cat /proc/filesystems
nodev   sysfs
nodev   rootfs
nodev   bdev
nodev   proc
nodev   tmpfs
nodev   binfmt_misc
nodev   debugfs
nodev   sockfs
nodev   usbfs
nodev   pipefs
nodev   anon_inodefs
nodev   devpts
   reiserfs
   ext3
   ext2
   ext4
nodev   ramfs
   vfat
   msdos
   iso9660
   ntfs
   udf
   squashfs
nodev   aufs
   fuseblk
nodev   fuse
nodev   fusectl
#


6.
Code:
# lsmod
Module                  Size  Used by
cpufreq_ondemand        4361  2
acpi_cpufreq            4301  1
mperf                    859  1 acpi_cpufreq
i915                  284201  2
drm_kms_helper         17719  1 i915
drm                   121515  3 i915,drm_kms_helper
video                   9383  1 i915
i2c_algo_bit            3672  1 i915
iptable_mangle           904  0
iptable_nat             2575  0
nf_nat                  9805  1 iptable_nat
ipt_REJECT              1517  1
nf_conntrack_ftp        4065  0
nf_conntrack_irc        2379  0
iptable_filter           804  1
xt_state                 791  4
nf_conntrack_ipv4       7266  7 iptable_nat,nf_nat
nf_conntrack           38062  6 iptable_nat,nf_nat,nf_conntrack_ftp,nf_conntrack_irc,xt_state,nf_conntrack_ipv4
nf_defrag_ipv4           787  1 nf_conntrack_ipv4
ip_tables               7021  3 iptable_mangle,iptable_nat,iptable_filter
snd_hda_codec_hdmi     18363  1
snd_hda_codec_realtek   135150  1
usblp                   7516  0
pcspkr                  1195  0
atl1c                  22782  0
snd_hda_intel          17167  0
snd_hda_codec          54456  3 snd_hda_codec_hdmi,snd_hda_codec_realtek,snd_hda_intel
snd_hwdep               3708  1 snd_hda_codec
snd_pcm_oss            27363  0
snd_mixer_oss           9850  1 snd_pcm_oss
snd_pcm                47145  4 snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec,snd_pcm_oss
snd_seq_dummy            907  0
i2c_i801                6166  0
i2c_core               12587  5 i915,drm_kms_helper,drm,i2c_algo_bit,i2c_i801
snd_seq_oss            19155  0
snd_seq_midi            3248  0
snd_seq_midi_event      3636  2 snd_seq_oss,snd_seq_midi
snd_rawmidi            11838  1 snd_seq_midi
snd_seq                32204  6 snd_seq_dummy,snd_seq_oss,snd_seq_midi,snd_seq_midi_event
snd_seq_device          3541  5 snd_seq_dummy,snd_seq_oss,snd_seq_midi,snd_rawmidi,snd_seq
snd_timer              11743  2 snd_pcm,snd_seq
shpchp                 17907  0
snd                    33354  13 snd_hda_codec_hdmi,snd_hda_codec_realtek,snd_hda_intel,snd_hda_codec,snd_hwdep,snd_pcm_oss,snd_mixer_oss,snd_pcm,snd_seq_oss,snd_rawmidi,snd_seq,snd_seq_device,snd_timer
soundcore               3321  1 snd
snd_page_alloc          4697  2 snd_hda_intel,snd_pcm
intel_agp               7984  1 i915
intel_gtt               9153  3 i915,intel_agp
agpgart                17858  3 drm,intel_agp,intel_gtt
parport_pc             18328  0
parport                20351  1 parport_pc
evdev                   5812  0
processor              21886  1 acpi_cpufreq
thermal_sys             9730  2 video,processor
hwmon                    877  1 thermal_sys
button                  3275  1 i915
fuse                   47727  0
aufs                  120424  72
squashfs               18852  1
#


Semme:
7. Ready to check for corruption. Very Happy
Back to top
View user's profile Send private message 
npierce

Joined: 28 Dec 2009
Posts: 854

PostPosted: Fri 01 Mar 2013, 10:35    Post subject:  

Sylvander, thanks for the information.

Sylvander wrote:
Code:
196 heads, 9 sectors/track, 1119 cylinders, total 1974271 sectors

. . .
Code:
00000000  00 20 21 00 0b c3 09 7a  00 08 00 00 00 10 1e 00  |. !....z........|

The partition table has fields for both CHS and LBA values. If CHS values are used, they should agree with the LBA values. The CHS values on your partition table do not agree with the LBA values.

If you are unfamiliar with the terms "CHS" and "LBA", you can read the next three paragraphs for a brief explanation. But you don't really need to know what they mean, so may skip ahead if you like.

----------------------------------------------------------------
Partition tables contain the information needed to find the starting sector and the ending sector of each partition. There are two ways of doing this.

The older way was to specify the cylinder, head, and sector (CHS). So a sector was identified by where it physically lived on the disk. That way requires knowing how many sectors were on each track of the cylinder and how many heads there were. As drives got bigger it became impossible to fit the actual cylinder number into the ten-bit field allowed for it, so a bit of poetic license was used to allow bigger drives, like specifying head numbers greater than the actual number of heads. Nowadays these numbers rarely refer to actual cylinders and heads. This is clearly the case for your flash drive, which has no physical cylinders or heads.

The newer way of doing things is to just identify each sector with a number, instead of by where it lives on the drive. This is known as "Logical Block Addressing" (LBA).
----------------------------------------------------------------

Normally, Linux only uses the LBA values, so I am a little surprised by the "CHS and LBA don't match" error message. Perhaps instead of simply ignoring the CHS values, something has noticed that they don't match and assumes that the partition is not really a type b FAT partition.

Two questions:

1. When did you see that error message? (Clicking on the icon? Using pmount? Using the mount command? Using some other utility and/or another non-Puppy operating system? Using gparted? Using fdisk? Something else?)

2. Do you still get that error message, and does it still say "Incorrect number of heads/cylinder 255 (FAT) !=32 (HD)", or have those values changed?


Anyway, some utility seems to have put bad values in the CHS fields. That utility assumed that the drive had 255 heads and 63 sectors per track (not actual physical heads and tracks, of course) -- those numbers are commonly used for large drives, since they are the maximum allowed for CHS, but your drive is not so large, and fdsik indicates that it has 196 heads and 9 sectors per track. So the utility got the values wrong.

Probably the easiest way to fix this is to change your drive type from type b (W95 FAT32) to type c (W95 FAT32 (LBA)), which uses Logical Block Addressing, and so the CHS values should be ignored.

I know that you intended to set the type to c earlier, but both "fdisk -l" and the raw partition table show that it is still b.

1. Run fdisk /dev/sdb

2. Press p then Enter to and look to make sure it is working on your flash drive ("Disk /dev/sdb: 1010 MB, 1010826752 bytes . . ."). (If not, press q then Enter to quit, and tell us what it said.)

3. Press t then Enter to prepare to change the type.

4. Press 1 then Enter to choose partition 1.

5. Press c then Enter to set type c.

6. Press p then Enter and look to ensure that the Id column says c and the System column says "W95 FAT32 (LBA)" (If not, press q then Enter to quit, and tell us what it said.)

7. Press w then Enter to write to the partition table.
Back to top
View user's profile Send private message 
amigo

Joined: 02 Apr 2007
Posts: 2165

PostPosted: Fri 01 Mar 2013, 11:26    Post subject:  

What exact command did you use to format the drive? (mkdosfs...)
Back to top
View user's profile Send private message 
Sylvander

Joined: 15 Dec 2008
Posts: 3246
Location: West Lothian, Scotland, UK

PostPosted: Fri 01 Mar 2013, 11:39    Post subject:  

npierce:
1. "When did you see that error message?"
Oh dear, I can only try to remember and guess.
Might have been in Testdisk, or Gparted, or Pmount->fdisk, or Falconfour's UBCD->XP->CheckDisk.
Hey, I notice I reported in the title, that it was TestDisk that gave that report. Very Happy

2. "Do you still get that error message?"
I'd need to attempt to retrace my steps and see if I encounter that message again.
Is that really necessary?

3. Followed your steps [with tiny deviations to truly put your intent into effect], as follows:
Code:
Command (m for help): m
Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   q   quit without saving changes
   s   create a new empty Sun disklabel
   t   change a partition's system id
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit
   x   extra functionality (experts only)

Command (m for help): p

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

Command (m for help): t
Selected partition 1
Hex code (type L to list codes): c
Changed system type of partition 1 to c (W95 FAT32 (LBA))

Command (m for help): p

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    c  W95 FAT32 (LBA)

Command (m for help):

Then entered w to write, and the console closed.
Should it do that?
Would that write only take effect after a reboot WITH SAVE of the session changes?
I notice that when I re-run "System->Pdisk->fdisk" on sdb1, and enter the command p, the Id=b and System=w95 FAT32!
In full:
Code:
Command (m for help): p

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


4. "The CHS values on your partition table do not agree with the LBA values.
Might we attempt to change so as to correct the CHS values?
Can you give me instructions to follow?

amigo:
5. "What exact command did you use to format the drive? (mkdosfs...)"
Originally, I used Gparted to reformat [the existing partition] from EXT3 to FAT32.
Then, through the course of this thread I've followed various instructions...
[And reported back on those]
Rather parrot fashion...
Since most are beyond my understanding.
Did any of those include yet another reformat?
GParted always reports a failure to reformat.
Also reports failure to delete the partition.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 3 of 11 [156 Posts]   Goto page: Previous 1, 2, 3, 4, 5, ..., 9, 10, 11 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Users ( For the regulars )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1216s ][ Queries: 12 (0.0041s) ][ GZIP on ]