Error while mounting any type of mass storage device

Kernels & Hardware, configuring network, installing services

Error while mounting any type of mass storage device

Postby patryk007 » 2012-07-20 13:19

Always when I plug my USB Pendrive or insert CD (or DVD) I get this error:
Code: Select all
Error mounting: mount: block device /dev/sr0 is write-protected, mounting read-only
mount: wrong fs type, bad option, bad superblock on /dev/sr0,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so


dmesg result:
Code: Select all
patryk007:~# dmesg |tail
[  765.630072] Bluetooth: BNEP filters: protocol multicast
[  767.471184] lp: driver loaded but no devices found
[  767.859463] ppdev: user-space parallel port driver
[  774.240035] wlan0: no IPv6 routers present
[  778.745219] NFSD: Using /var/lib/nfs/v4recovery as the NFSv4 state recovery directory
[  778.756898] NFSD: starting 90-second grace period
[ 5683.013605] sd 0:0:0:0: Attached scsi generic sg0 type 0
[ 5683.013695] sr 1:0:0:0: Attached scsi generic sg1 type 5
[ 6772.206456] ISO 9660 Extensions: Microsoft Joliet Level 1


As far as I remember, I could have screwed something up while configuring one of the kernel's config (I guess 2.6.x config).
I hoped that after upgrading kernel to 3.1.1 from repo everything will be fine because system uses its default kernel's configuration while upgrading kernel from repository. But I was wrong. After upgrading kernel to 3.1.1 I have still problem with this error.

I've tried to solve this problem compiling kernel manually. I've selected missing (I guess) ISO 9660 format, somewhere in kernel's config. Problem was solved until updates came. Updates came with upgrading kernel version and the problem is back. ;/

I want to solve this problem once and for all. But how?
patryk007
 
Posts: 43
Joined: 2011-01-07 12:03
Location: Poland

Re: Error while mounting any type of mass storage device

Postby Quantum » 2012-07-20 13:30

You do have a new config when you installed the 3.1 linux-image. It'll be in /boot/config-???.

Looks like it might not be loading the right drivers. (dmesg tail) Let's see lsusb.

How are you mounting this drive? If you have an fstab entry, is the filesystem type udf,iso9660? Have you tried plugging with CD and DVD?
Quantum
 
Posts: 1455
Joined: 2006-03-21 19:06
Location: Seattle, Ecotopia

Re: Error while mounting any type of mass storage device

Postby patryk007 » 2012-07-20 14:59

I assumed that after inserting CD or plugging in USB flash-drive, Debian will automatically mount device properly.
I didn't mount it manually but now I'm giving a try mounting my pendrive:

Listing device's partition:
Code: Select all
patryk007:/home/patryk007/Desktop# fdisk -l

(...)

Disk /dev/sdb: 1008 MB, 1008729600 bytes
4 heads, 8 sectors/track, 61567 cylinders, total 1970175 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: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           8     1970174      985083+   b  W95 FAT32


Mounting:
Code: Select all
patryk007:/home/patryk007/Desktop# mount /dev/sdb1 ./tmp/
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


Now dmesg |tail returns:
Code: Select all
patryk007:/home/patryk007/Desktop# dmesg |tail
[13327.517117] sd 2:0:0:0: [sdb] No Caching mode page present
[13327.517124] sd 2:0:0:0: [sdb] Assuming drive cache: write through
[13327.519368] sd 2:0:0:0: [sdb] No Caching mode page present
[13327.519378] sd 2:0:0:0: [sdb] Assuming drive cache: write through
[13327.521334]  sdb: sdb1
[13327.525869] sd 2:0:0:0: [sdb] No Caching mode page present
[13327.525880] sd 2:0:0:0: [sdb] Assuming drive cache: write through
[13327.525888] sd 2:0:0:0: [sdb] Attached SCSI removable disk
[13885.310766] FAT-fs (sdb1): codepage cp437 not found
[14237.855046] FAT-fs (sdb1): codepage cp437 not found


So I'm checking my kernel's (3.1.1) config:
Code: Select all
patryk007:/# cat /boot/config-3.1.1 |grep 437
CONFIG_FAT_DEFAULT_CODEPAGE=437
# CONFIG_NLS_CODEPAGE_437 is not set


Still don't know what's wrong.
Should CONFIG_NLS_CODEPAGE_437 be loaded as a module?
If yes then why it is not compiled in kernel or loaded as module? Kernel 3.1.1 was installed from repo so everything should be set fine. But it isn't.

__ __ __ __ __

[edit]

Interesting thing:
Code: Select all
patryk007:/home/patryk007/Desktop# ls /boot
config-2.6.36.old  config-2.6.38.6  config-3.1.1  grub   initrd.img-2.6.38.6  initrd.img-3.1.1  System.map-2.6.38.6  System.map-3.1.1  vmlinuz-2.6.38.6   vmlinuz-3.1.1
patryk007:/home/patryk007/Desktop# cat /boot/config-2.6.36.old |grep 437
CONFIG_FAT_DEFAULT_CODEPAGE=437
CONFIG_NLS_CODEPAGE_437=m
patryk007:/home/patryk007/Desktop# cat /boot/config-2.6.38.6 |grep 437
CONFIG_FAT_DEFAULT_CODEPAGE=437
CONFIG_NLS_CODEPAGE_437=m
patryk007
 
Posts: 43
Joined: 2011-01-07 12:03
Location: Poland

Re: Error while mounting any type of mass storage device

Postby peter_irich » 2012-07-20 15:42

If you have not records for CD or USB on /etc/fstab, try add its and reboot.
Far example, in my /etc/fstab for CD/DVD
Code: Select all
/dev/cdrom2       /media/cdrom0   udf,iso9660 ro,users,noauto     0       0
/dev/cdrw2       /media/cdrom0   udf,iso9660 ro,users,noauto     0       0
/dev/dvd2       /media/cdrom0   iso13346,udf ro,users,noauto     0       0
/dev/dvdrw2       /media/cdrom0   udf,iso9660 ro,users,noauto     0       0

for USB one of two
Code: Select all
#/dev/sdc1 /media/usb0 auto rw,users,noauto,noexec 0 0
/dev/sdc1 /media/usb0 vfat rw,users,noauto,iocharset=utf8,codepage=866,noexec,showexec 0 0

If after rebooting automounting will not be right, try mount storage as root with direct pointing fs type,
see "man mount "-t" option.

Peter.
peter_irich
 
Posts: 1200
Joined: 2009-09-10 20:15
Location: Saint-Petersburg, Russian Federation

Re: Error while mounting any type of mass storage device

Postby emariz » 2012-07-20 16:03

As already pointed out, this is mostly likely an "error" in /etc/fstab. Another process, say, the installer, created an entry in Fstab and now the system is trying to mount removable devices using that entry instead of letting Udev decide what to do.

Also, why did you install kernel 3.1+ instead of 3.2+? The latter is even available in Backports.
emariz
 
Posts: 2887
Joined: 2008-10-17 07:59

Re: Error while mounting any type of mass storage device

Postby patryk007 » 2012-07-20 20:09

peter_irich wrote:
Code: Select all
/dev/cdrom2       /media/cdrom0   udf,iso9660 ro,users,noauto     0       0
/dev/cdrw2       /media/cdrom0   udf,iso9660 ro,users,noauto     0       0
/dev/dvd2       /media/cdrom0   iso13346,udf ro,users,noauto     0       0
/dev/dvdrw2       /media/cdrom0   udf,iso9660 ro,users,noauto     0       0

Why /dev/cdrom2, not /dev/cdrom or /dev/cdrom0 or /dev/cdrom1 (and cdrw2, dvd2, dvdrw2)?

My /etc/fstab (sorry for ugly formatting):
Code: Select all
# /etc/fstab: static file system information.
#
# <file system>                  <mount point>      <type>      <options>      <dump>  <pass>
  proc                           /proc              proc          defaults          0         0

# /dev/sda1                    /                 ext3      errors=remount-ro   0   1
  UUID=e304b18f-7cef-4ba8-ae29-9ace105bc001      /         ext3      errors=remount-ro,user_xattr   0   1

# /dev/sda5                  none         swap      sw         0   0
  UUID=6729668f-8166-459a-b611-0768dcd9aaf2      none         swap      sw         0   0

  /dev/scd0                        /media/cdrom0      udf,iso9660   user,noauto      0   0

As you can see there are no flash-disks. Only CDROM, which is mounted automatically with errors (as I mentioned in previous post).
patryk007
 
Posts: 43
Joined: 2011-01-07 12:03
Location: Poland

Re: Error while mounting any type of mass storage device

Postby Quantum » 2012-07-20 20:53

Now hang on a second. WTF is this:

patryk007 wrote:
Code: Select all
patryk007:/home/patryk007/Desktop# fdisk -l

(...)

Disk /dev/sdb: 1008 MB, 1008729600 bytes
4 heads, 8 sectors/track, 61567 cylinders, total 1970175 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: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           8     1970174      985083+   b  W95 FAT32

sdb1 is showing up as vfat? Why is that? This can't be a CD or DVD.

Is this what you're trying to mount?
Quantum
 
Posts: 1455
Joined: 2006-03-21 19:06
Location: Seattle, Ecotopia

Re: Error while mounting any type of mass storage device

Postby patryk007 » 2012-07-20 21:19

/dev/sdb1 is USB flash disk's partition (USB pendrive).

I fixed one thing - CDROM - CDROM had wrong device name in fstab. In /etc/fstab I had /dev/scd0 which doesn't exist (but I can remember it used to exist). CDROM is now in /dev/sr0. I created symlink /dev/scd0 to /dev/sr0 and it works.

But USB flash disk still doesn't work.

Code: Select all
patryk007:/home/patryk007/Desktop# fdisk -l

(...)

Disk /dev/sdb: 16.0 GB, 16001269760 bytes
97 heads, 7 sectors/track, 46027 cylinders, total 31252480 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: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *        2048    31252479    15625216    6  FAT16

patryk007:/home/patryk007/Desktop# mount -t vfat /dev/sdb1 ./tmp
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

patryk007:/home/patryk007/Desktop# dmesg |tail
[36110.858831] UDF-fs: No partition found (1)
[36110.893977] ISO 9660 Extensions: Microsoft Joliet Level 3
[36111.951738] ISO 9660 Extensions: RRIP_1991A
[36746.325964] sd 5:0:0:0: [sdb] No Caching mode page present
[36746.325970] sd 5:0:0:0: [sdb] Assuming drive cache: write through
[36746.336423]  sdb: sdb1
[36782.929594] FAT-fs (sdb1): codepage cp437 not found
[36825.576314] FAT-fs (sdb1): codepage cp437 not found
[36831.323306] FAT-fs (sdb1): codepage cp437 not found
[36886.760994] FAT-fs (sdb1): codepage cp437 not found
patryk007
 
Posts: 43
Joined: 2011-01-07 12:03
Location: Poland

Re: Error while mounting any type of mass storage device

Postby Hallvor » 2012-07-20 21:29

Did you try installing the package usbmount?
Intel Core i5 3320-M CPU @ 2.60 GHz, 6 GB RAM, Intel HD 4000 graphics, 300 GB HDD, Debian Stretch (KDE)
User avatar
Hallvor
 
Posts: 739
Joined: 2009-04-16 18:35
Location: Norway

Re: Error while mounting any type of mass storage device

Postby Quantum » 2012-07-20 21:41

patryk007 wrote:Device Boot Start End Blocks Id System
/dev/sdb1 * 2048 31252479 15625216 6 FAT16


Now hold still a second now. This is a different flash, because it's formatted with fat (16), not vfat (fat32). So you'll
$ sudo mount -t fat /dev/sdb1 /media/{whereever}

Tother one you'll use mount -t vfat ...
Quantum
 
Posts: 1455
Joined: 2006-03-21 19:06
Location: Seattle, Ecotopia

Re: Error while mounting any type of mass storage device

Postby peter_irich » 2012-07-21 06:51

It is possible use
Code: Select all
mount -t vfat -o fat=16 /dev/sdb1 /mount_point


Peter.
peter_irich
 
Posts: 1200
Joined: 2009-09-10 20:15
Location: Saint-Petersburg, Russian Federation


Return to System configuration

Who is online

Users browsing this forum: Alexa [Bot] and 7 guests

fashionable