本文共 2286 字,大约阅读时间需要 7 分钟。
最近工作中遇到一个问题,在linux mount /dev/sdb 到 /mnt 分区时报错:
[root@centos6 ~]# mount /dev/sdb /mnt/mount: you must specify the filesystem type报错主要是因为没有指定文件系统格式。1、查看磁盘设备
[root@centos6 ~]# fdisk -lDisk /dev/sda: 21.5 GB, 21474836480 bytes255 heads, 63 sectors/track, 2610 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x0004cd37 Device Boot Start End Blocks Id System/dev/sda1 * 1 26 204800 83 LinuxPartition 1 does not end on cylinder boundary./dev/sda2 26 91 524288 82 Linux swap / SolarisPartition 2 does not end on cylinder boundary./dev/sda3 91 2611 20241408 83 LinuxDisk /dev/sdb: 105 MB, 105906176 bytes64 heads, 32 sectors/track, 101 cylindersUnits = cylinders of 2048 * 512 = 1048576 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x00000000
2、先执行:mkfs.ext4 /dev/sdb
[root@centos6 ~]# mkfs.ext4 /dev/sdbmke2fs 1.41.12 (17-May-2010)/dev/sdb is entire device, not just one partition!Proceed anyway? (y,n) yFilesystem label=OS type: LinuxBlock size=1024 (log=0)Fragment size=1024 (log=0)Stride=0 blocks, Stripe width=0 blocks25896 inodes, 103424 blocks5171 blocks (5.00%) reserved for the super userFirst data block=1Maximum filesystem blocks=6737100813 block groups8192 blocks per group, 8192 fragments per group1992 inodes per groupSuperblock backups stored on blocks: 8193, 24577, 40961, 57345, 73729Writing inode tables: done Creating journal (4096 blocks): doneWriting superblocks and filesystem accounting information: doneThis filesystem will be automatically checked every 34 mounts or180 days, whichever comes first. Use tune2fs -c or -i to override.
3、再mount 即可:
mount -t ext4 /dev/sdb /mnt[root@centos6 ~]# mount /dev/sdb /mnt[root@centos6 ~]# df -h
4、查看挂载后状态。
[root@centos6 ~]# 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转载于:https://blog.51cto.com/gotoo/2095833