挂载磁盘出错

最近工作中遇到一个问题,在linux mount /dev/sdb 到 /mnt 分区时报错:
[root@centos6 ~]# mount /dev/sdb /mnt/
mount: you must specify the filesystem type
报错主要是因为没有指定文件系统格式。

1、查看磁盘设备
[root@centos6 ~]# 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
[root@centos6 ~]# 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
[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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值