挂载磁盘出错
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了挂载磁盘出错相关的知识,希望对你有一定的参考价值。
最近工作中遇到一个问题,在linux mount /dev/sdb 到 /mnt 分区时报错:[[email protected] ~]# mount /dev/sdb /mnt/
mount: you must specify the filesystem type
报错主要是因为没有指定文件系统格式。
1、查看磁盘设备
[[email protected] ~]# fdisk -l
Disk /dev/sda: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 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: 0x0004cd37
Device Boot Start End Blocks Id System
/dev/sda1 * 1 26 204800 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 26 91 524288 82 Linux swap / Solaris
Partition 2 does not end on cylinder boundary.
/dev/sda3 91 2611 20241408 83 Linux
Disk /dev/sdb: 105 MB, 105906176 bytes
64 heads, 32 sectors/track, 101 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
2、先执行:mkfs.ext4 /dev/sdb
[[email protected] ~]# mkfs.ext4 /dev/sdb
mke2fs 1.41.12 (17-May-2010)
/dev/sdb is entire device, not just one partition!
Proceed anyway? (y,n) y
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
Stride=0 blocks, Stripe width=0 blocks
25896 inodes, 103424 blocks
5171 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=67371008
13 block groups
8192 blocks per group, 8192 fragments per group
1992 inodes per group
Superblock backups stored on blocks:
8193, 24577, 40961, 57345, 73729
Writing inode tables: done
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 34 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
3、再mount 即可:
mount -t ext4 /dev/sdb /mnt
[[email protected] ~]# mount /dev/sdb /mnt
[[email protected] ~]# df -h
4、查看挂载后状态。
[[email protected] ~]# df -Th
Filesystem Type Size Used Avail Use% Mounted on
/dev/sda3 ext4 19G 2.2G 16G 13% /
tmpfs tmpfs 238M 0 238M 0% /dev/shm
/dev/sda1 ext4 190M 40M 141M 22% /boot
/dev/sdb ext4 94M 1.6M 88M 2% /mnt
以上是关于挂载磁盘出错的主要内容,如果未能解决你的问题,请参考以下文章
Centos /etc/fstab/出错,提示 Give root password maintenance