azure云中 mount: wrong fs type, bad option, bad superblock on /dev/sdc1

2016-01-30 mount失败问题解决

问题记录:

	[root@mofficedb2 ~]# mount /dev/sdc /dta
	mount: you must specify the filesystem type
	[root@mofficedb2 ~]#
	[root@mofficedb1 ~]# mount -t ext4 /dev/sdc1 /data
	mount: wrong fs type, bad option, bad superblock on /dev/sdc1,
		   missing codepage or helper program, or other error
		   In some cases useful info is found in syslog - try
		   dmesg | tail  or so

排查

	[root@mofficedb1 ~]# cat  /proc/filesystems
	nodev	sysfs
	nodev	rootfs
	nodev	bdev
	nodev	proc
	nodev	cgroup
	nodev	cpuset
	nodev	tmpfs
	nodev	devtmpfs
	nodev	binfmt_misc
	nodev	debugfs
	nodev	securityfs
	nodev	sockfs
	nodev	usbfs
	nodev	pipefs
	nodev	anon_inodefs
	nodev	inotifyfs
	nodev	devpts
	nodev	ramfs
	nodev	hugetlbfs
		iso9660
	nodev	pstore
	nodev	mqueue
	nodev	selinuxfs
		ext4
	nodev	autofs
	[root@mofficedb1 ~]# 

查看后台支持的文件格式,其中2.6.32-431.29.2.el6.x86_64目录因系统版本会不一样,可以通过find /lib/modules/ -name kernel命令查找出真实目录

	[root@mofficedb1 ~]# ll /lib/modules/2.6.32-431.29.2.el6.x86_64/kernel/fs
	total 132
	drwxr-xr-x. 2 root root  4096 Sep 25  2014 autofs4
	drwxr-xr-x. 2 root root  4096 Sep 25  2014 btrfs
	drwxr-xr-x. 2 root root  4096 Sep 25  2014 cachefiles
	drwxr-xr-x. 2 root root  4096 Sep 25  2014 cifs
	drwxr-xr-x. 2 root root  4096 Sep 25  2014 configfs
	drwxr-xr-x. 2 root root  4096 Sep 25  2014 cramfs
	drwxr-xr-x. 2 root root  4096 Sep 25  2014 dlm
	drwxr-xr-x. 2 root root  4096 Sep 25  2014 ecryptfs
	drwxr-xr-x. 2 root root  4096 Sep 25  2014 exportfs
	drwxr-xr-x. 2 root root  4096 Sep 25  2014 ext2
	drwxr-xr-x. 2 root root  4096 Sep 25  2014 ext3
	drwxr-xr-x. 2 root root  4096 Sep 25  2014 ext4
	drwxr-xr-x. 2 root root  4096 Sep 25  2014 fat
	drwxr-xr-x. 2 root root  4096 Sep 25  2014 fscache
	drwxr-xr-x. 2 root root  4096 Sep 25  2014 fuse
	drwxr-xr-x. 2 root root  4096 Sep 25  2014 gfs2
	drwxr-xr-x. 2 root root  4096 Sep 25  2014 jbd
	drwxr-xr-x. 2 root root  4096 Sep 25  2014 jbd2
	drwxr-xr-x. 2 root root  4096 Sep 25  2014 jffs2
	drwxr-xr-x. 2 root root  4096 Sep 25  2014 lockd
	-rwxr--r--. 1 root root 19920 Sep  9  2014 mbcache.ko
	drwxr-xr-x. 2 root root  4096 Sep 25  2014 nfs
	drwxr-xr-x. 2 root root  4096 Sep 25  2014 nfs_common
	drwxr-xr-x. 2 root root  4096 Sep 25  2014 nfsd
	drwxr-xr-x. 2 root root  4096 Sep 25  2014 nls
	drwxr-xr-x. 2 root root  4096 Sep 25  2014 squashfs
	drwxr-xr-x. 2 root root  4096 Sep 25  2014 ubifs
	drwxr-xr-x. 2 root root  4096 Sep 25  2014 udf
	drwxr-xr-x. 2 root root  4096 Sep 25  2014 xfs
	[root@mofficedb1 ~]# 

查看本系统的文件格式:

[root@mofficedb1 ~]# df -T -h
Filesystem     Type   Size  Used Avail Use% Mounted on
/dev/sda1      ext4    29G  2.8G   25G  11% /
tmpfs          tmpfs   14G     0   14G   0% /dev/shm
/dev/sdb1      ext4    56G  180M   53G   1% /mnt/resource
[root@mofficedb1 ~]# 

fdisk /dev/sdc后,出现/dev/sdc1

Disk /dev/sdc: 53.7 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x4cb42802

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1        6527    52428096   83  Linux
[root@mofficedb2 ~]# 

有一个输入w的命令是写磁盘文件初始化的,如果失败了没有成功,就执行mkfs.ext4 /dev/sdc1

mkfs.ext4 /dev/sdc1
[root@mofficedb2 ~]# mkfs.ext4 /dev/sdc1
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
3276800 inodes, 13107024 blocks
655351 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
400 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
	4096000, 7962624, 11239424

Writing inode tables: done                            
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: 
done

This filesystem will be automatically checked every 37 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
[root@mofficedb2 ~]# 

[root@mofficedb2 ~]# mount /dev/sdc1 /data
[root@mofficedb2 ~]# df -T -h
Filesystem     Type   Size  Used Avail Use% Mounted on
/dev/sda1      ext4    29G  2.4G   25G   9% /
tmpfs          tmpfs   14G     0   14G   0% /dev/shm
/dev/sdb1      ext4    56G  180M   53G   1% /mnt/resource
/dev/sdc1      ext4    50G  180M   47G   1% /data
[root@mofficedb2 ~]# 

PS:网友的方案
超级块损坏,但是文件系统都是有超级块备份的,只需要重新恢复超级块就可以了
mkfs.ext4 -n device
该命令最好就是超级块的备份位置
mkfs.ext4 -b superblocknum device
这样就行了

为了使mount在重启vm后生效,还需要配置/etc/fstab
vim /etc/fstab
/dev/sdc /data ext4 defaults 1 2

重启后,出现 Could not chdir to home directory /home/adminuser: No such file or directory的错误
是因为/etc/fstab里面配置错误
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值