linux新硬盘格式化挂载

Posted on Posted in linux
Tips: 本文创建于2013年11月24日,已超过 2 年,内容或图片可能已经失效!
[root@localhost ~]# fdisk /dev/sdb  
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel  
Building a new DOS disklabel with disk identifier 0xabc4bf17.  
Changes will remain in memory only, until you decide to write them.  
After that, of course, the previous content won't be recoverable.  
  
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)  
  
WARNING: DOS-compatible mode is deprecated. It's strongly recommended to  
         switch off the mode (command 'c') and change display units to  
         sectors (command 'u').  
  
Command (m for help): n  
Command action  
   e   extended  
   p   primary partition (1-4)  
p  
Partition number (1-4):   
Value out of range.  
Partition number (1-4): 1  
First cylinder (1-261, default 1):   
Using default value 1  
Last cylinder, +cylinders or +size{K,M,G} (1-261, default 261):   
Using default value 261  
  
Command (m for help): w  
The partition table has been altered!  
  
Calling ioctl() to re-read partition table.  
Syncing disks.  
[root@localhost ~]# partprobe  
[root@localhost ~]# mkfs.ext4 /dev/sdb1  
mke2fs 1.41.12 (17-May-2010)  
文件系统标签=  
操作系统:Linux  
块大小=4096 (log=2)  
分块大小=4096 (log=2)  
Stride=0 blocks, Stripe width=0 blocks  
131072 inodes, 524112 blocks  
26205 blocks (5.00%) reserved for the super user  
第一个数据块=0  
Maximum filesystem blocks=536870912  
16 block groups  
32768 blocks per group, 32768 fragments per group  
8192 inodes per group  
Superblock backups stored on blocks:   
    32768, 98304, 163840, 229376, 294912  
  
正在写入inode表: 完成                              
Creating journal (8192 blocks): 完成  
Writing superblocks and filesystem accounting information: 完成  
  
This filesystem will be automatically checked every 36 mounts or  
180 days, whichever comes first.  Use tune2fs -c or -i to override.  
[root@localhost ~]# mkdir /sdb  
[root@localhost ~]# vim /etc/fstab   
/dev/sdb1       /sdb            ext4    defaults    0 0 
» 转载请注明来源:若我若鱼 » linux新硬盘格式化挂载

Leave a Reply

Your email address will not be published. Required fields are marked *

2 + 11 =