Linux空硬盘从分区到挂载

[root@CentOS6 桌面]# 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 0x4ef8fb05.
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): 1
First cylinder (1-2610, default 1): 
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-2610, default 2610): 
Using default value 2610

Command (m for help): w    //保存退出
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
[root@CentOS6 桌面]# mkdir /newpar    //创建挂载的文件夹
[root@CentOS6 桌面]# mkfs.ext4 /dev/sdb1    //ext4格式化
mke2fs 1.41.12 (17-May-2010)
文件系统标签=
操作系统:Linux
块大小=4096 (log=2)
分块大小=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
1310720 inodes, 5241198 blocks
262059 blocks (5.00%) reserved for the super user
第一个数据块=0
Maximum filesystem blocks=4294967296
160 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, 2654208, 
	4096000

正在写入inode表: 完成                            
Creating journal (32768 blocks): 完成
Writing superblocks and filesystem accounting information: 完成

This filesystem will be automatically checked every 22 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
[root@CentOS6 桌面]# mount /dev/sdb1 /newpar    //将分区挂载
[root@CentOS6 桌面]# df -h    //查看挂载情况
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_centos6-lv_root
                       50G  3.7G   43G   8% /
tmpfs                 932M  228K  932M   1% /dev/shm
/dev/sda1             477M   40M  412M   9% /boot
/dev/mapper/vg_centos6-lv_home
                       45G   52M   43G   1% /home
/dev/sdb1              20G   44M   19G   1% /newpar

猜你喜欢

转载自www.cnblogs.com/diantong/p/8855683.html
今日推荐