解决Debian squeeze无法自动挂在USB设备,debiansqueeze并且只能用root权


Debian squeeze+gnome无法挂载ext3格式的U盘,错误提示如下:

"Error mounting: mount exited with exit code 1: helper failed with:
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"

但是使用mount命令缺可以挂载,并且工作正常。并且只能用root权限挂载:

# sudo mount /dev/sdb1 /media/tmp

dmesg|tail信息大体如下:

kernel: [ 1608.008314] scsi 9:0:0:0: Direct-Access SanDisk SanDisk Cruzer
8.02 PQ: 0 ANSI: 0 CCS
kernel: [ 1608.010113] sd 9:0:0:0: Attached scsi generic sg2 type 0
kernel: [ 1608.010886] sd 9:0:0:0: [sdb] 15753215 512-byte logical blocks:
(8.06 GB/7.51 GiB)
kernel: [ 1608.011382] sd 9:0:0:0: [sdb] write Protect is off
kernel: [ 1608.011385] sd 9:0:0:0: [sdb] Mode Sense: 45 00 00 08
kernel: [ 1608.011387] sd 9:0:0:0: [sdb] Assuming drive cache: write through
kernel: [ 1608.014133] sd 9:0:0:0: [sdb] Assuming drive cache: write through
kernel: [ 1608.014141] sdb: sdb1 sdb2 sdb3
kernel: [ 1608.016644] sd 9:0:0:0: [sdb] Assuming drive cache: write through
kernel: [ 1608.016649] sd 9:0:0:0: [sdb] Attached SCSI removable disk
kernel: [ 1609.068133] UDF-fs: No VRS found
kernel: [ 1609.068137] UDF-fs: Rescanning with blocksize 2048
kernel: [ 1609.602188] EXT4-fs (sdb2): mounted filesystem with ordered data
mode
kernel: [ 1609.683431] UDF-fs: No VRS found
kernel: [ 1609.683439] UDF-fs: No partition found (1)
kernel: [ 1609.726774] ISOFS: Unable to identify cd-ROM format.

大概问题是,根据Debian安装文档,使用USB安装系统,直接将镜像拷贝到USB设备(# cat debian.iso >/dev/sdX). 安装完成后,该USB设备被当成iso9660/udf文件系统记录到/etc/fstab中,所以自动挂载USB驱动器会失败只需要删掉/etc/fstab文件中对应的内容,问题就可以解决。

# /etc/fstab: static file system information.
#
# Use 'vol_id --uuid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
 # <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
 # / was on /dev/sda1 during installation
 UUID=618d3c71-f02d-47d4-a0ba-9cc456517e61 / ext4
 errors=remount-ro 0 1
# swap was on /dev/sda5 during installation
UUID=53aaef30-f32e-4576-ac50-e30f7701d0e8 none swap sw
0 0
/dev/sdb1 /media/cdrom0 udf,iso9660 user,noauto 0 0

即上面红色行

参考资料:

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=612119http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=597223a

相关内容