1 (edited by Mohamed_Ahmed 2014-03-22 10:58:08)

Topic: CF card not mounting properly

I have a 2G compact flash card. If I plug it to the card reader and attached it to the computer a message appears saying the following:

Error mounting /dev/sdb1 at /media/mohamed/BFD9-91BB: Command-line `mount -t "vfat" -o "uhelper=udisks2,nodev,nosuid,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,showexec,flush" "/dev/sdb1" "/media/mohamed/BFD9-91BB"' exited with non-zero exit status 32: mount: /dev/sdb1: can't read superblock

I tried using formatting by right clicking the drive and choosing "Format" to FAT. But the problem is sill there. Going to GParted in hope to solve the problem by deleting and creating a new filesystem. I created a new FAT32 filesystem after removing the previous one. A round "i" mark appears beside the drive path "/dev/sdb1". I tried to "Check" the filesystem by rightclicking and hitting the "Check" item. It returned

Bad FAT: cluster 201325560 outside file system in chain for \.  You should run dosfsck or scandisk.

But I have no knowledge of this tools and how I can use them. I should also mention also that If I try to format the CF card to ext2 filesystem. The filesystem becomes unknown.

2

Re: CF card not mounting properly

Is the CF card partitioned?

To check, you might provide the output from the following two commands:

sudo fdisk -l -u

where one of the options is a lower case "L" and not the number one.

sudo parted /path-to-your-device unit s print

where /path-to-your-device is something like /dev/sda.

If the CF card does not contain a partition table, then the mount command should use the device (/dev/sdb) instead of the first partition (/dev/sdb1).

3 (edited by Mohamed_Ahmed 2014-03-25 01:00:26)

Re: CF card not mounting properly

The output of 'sudo fdisk -l -u':
Disk /dev/sdb: 2012 MB, 2012250112 bytes
251 heads, 63 sectors/track, 248 cylinders, total 3930176 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: 0x9b9cc388

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1             255     3929151     1964448+   7  HPFS/NTFS/exFAT

The output of 'sudo parted /div/sdb unit s print'
Model: Generic Compact Flash (scsi)
Disk /dev/sdb: 3930176s
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start  End       Size      Type     File system  Flags
1      255s   3929151s  3928897s  primary

The problem is that the CF card is not readable on Ubuntu's file browser. But, GParted sees the drive.

4

Re: CF card not mounting properly

One clue to the problem might be that the parted command was unable to determine the file system on the sdb1 partition.

Do you recall how the CF card was originally formatted?

Would you be able to provide the output from the following command:

sudo blkid /dev/sdb1

5

Re: CF card not mounting properly

Sorry, I don't recall how the CF card was originally formatted. The output of 'sudo blkid /dev/sdb1' is:
/dev/sdb1: SEC_TYPE="msdos" LABEL="JO NAMA" UUID="E321-E793" TYPE="vfat"

6

Re: CF card not mounting properly

Blkid sees the partition as vfat which means it is one of the file allocation table formats (16/32).

You might try booting into Windows and then running chkdsk on the partition/drive letter.  Perhaps after that parted and the mount command might work.

7

Re: CF card not mounting properly

I have been able to format the drive to FAT. It seems that the CF card can't be formatted to any other file system If I ran 'tail -f /var/log/messages' I get 'Volume was not properly unmounted. Some data may be corrupt. Please run fsck.' When I run 'fsck' it returns "0x25: Dirty bit is set. Fs was not properly unmounted and some data may be corrupt." Do I delete this bit or what?

8

Re: CF card not mounting properly

If you have Windows, you might try running "chkdsk /f" on the CF card that is formatted with FAT.

9

Re: CF card not mounting properly

Does chkdsk require administrative privileges? And how can I specify the drive name in the command chkdsk?

10

Re: CF card not mounting properly

In Windows first determine which drive letter is assigned to the card, and then provide the drive letter to the chkdsk command.  For example, "chkdsk /f F:"

Do you use this CF Card in a camera?
If so, and the CF Card has been backed up or does not otherwise contain data you wish to keep, then try placing the card in the camera and using the camera's software to format the card.