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里面配置错误