萬盛學電腦網

 萬盛學電腦網 >> 服務器教程 >> linux中掛載硬盤報錯(you must specify the filesystem type)

linux中掛載硬盤報錯(you must specify the filesystem type)

   今天自己的虛擬機磁盤用完成,於是想加一磁盤,當掛載時發現報錯you must specify the filesystem type。(注:我的系統環境是lcentos6.3裝在virtualbox的虛擬機)

  原來是因為該磁盤沒有格式分區導致的於是有了以下操作:

  1)先查看一下當前的系統情況,新加的盤是sdb

 代碼如下  

[root@test ~]# lsblk
NAME                        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sr0                          11:0    1  1024M  0 rom 
sda                           8:0    0     8G  0 disk
├─sda1                        8:1    0   500M  0 part /boot
└─sda2                        8:2    0   7.5G  0 part
  ├─VolGroup-lv_root (dm-0) 253:0    0   6.6G  0 lvm  /
  └─VolGroup-lv_swap (dm-1) 253:1    0   992M  0 lvm  [SWAP]
sdb                           8:16   0     8G  0 disk

  2)嘗試掛載,報錯

 代碼如下   [root@test ~]# mount /dev/sdb /disk

  mount: you must specify the filesystem type

  3)格式化該磁盤

 代碼如下   [root@test ~]# mkfs.ext3 /dev/sdb
mke2fs 1.41.12 (17-May-2010)
/dev/sdb is entire device, not just one partition!
無論如何也要繼續? (y,n) y
文件系統標簽=
操作系統:Linux
塊大小=4096 (log=2)
分塊大小=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
524288 inodes, 2097152 blocks
104857 blocks (5.00%) reserved for the super user
第一個數據塊=0
Maximum filesystem blocks=2147483648
64 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
 
正在寫入inode表: 完成                           
Creating journal (32768 blocks): 完成
Writing superblocks and filesystem accounting information: 完成
 
This filesystem will be automatically checked every 27 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
[root@test ~]#

  4)掛載成功

 代碼如下  


[root@test ~]# cd /disk/
[root@test disk]# ls

copyright © 萬盛學電腦網 all rights reserved