linux格式化挂载磁盘,linux 格式化分区,挂载磁盘

如果分区没有格式化 , 挂载之前必须格式化

df -h

sudo fdisk -l

mount /dev/xvdb /home

mkfs -t ext3 /dev/vdb

mount /dev/vdb /home

[root@qianliyan4g1 ~]# df -h

Filesystem Size Used Avail Use% Mounted on

/dev/vda1 20G 2.3G 17G 12% /

devtmpfs 7.8G 0 7.8G 0% /dev

tmpfs 7.8G 0 7.8G 0% /dev/shm

tmpfs 7.8G 416K 7.8G 1% /run

tmpfs 7.8G 0 7.8G 0% /sys/fs/cgroup

[root@qianliyan4g1 ~]# fdisk -l

Disk /dev/vda: 21.5 GB, 21474836480 bytes, 41943040 sectors

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk label type: dos

Disk identifier: 0x000b9a2e

Device Boot Start End Blocks Id System

/dev/vda1 * 2048 41929649 20963801 83 Linux

Disk /dev/vdb: 214.7 GB, 214748364800 bytes, 419430400 sectors

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

[root@qianliyan4g1 ~]#

[root@qianliyan4g1 ~]#

[root@qianliyan4g1 ~]# sudo fdisk -l

Disk /dev/vda: 21.5 GB, 21474836480 bytes, 41943040 sectors

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk label type: dos

Disk identifier: 0x000b9a2e

Device Boot Start End Blocks Id System

/dev/vda1 * 2048 41929649 20963801 83 Linux

Disk /dev/vdb: 214.7 GB, 214748364800 bytes, 419430400 sectors

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

[root@qianliyan4g1 ~]# mount /dev/vdb /home

mount: /dev/vdb is write-protected, mounting read-only

mount: unknown filesystem type '(null)'

[root@qianliyan4g1 ~]# df -h

Filesystem Size Used Avail Use% Mounted on

/dev/vda1 20G 2.3G 17G 12% /

devtmpfs 7.8G 0 7.8G 0% /dev

tmpfs 7.8G 0 7.8G 0% /dev/shm

tmpfs 7.8G 416K 7.8G 1% /run

tmpfs 7.8G 0 7.8G 0% /sys/fs/cgroup

[root@qianliyan4g1 ~]#

[root@qianliyan4g1 ~]#

[root@qianliyan4g1 ~]# mkfs -t ext3 /dev/vdb

mke2fs 1.42.9 (28-Dec-2013)

Filesystem label=

OS type: Linux

Block size=4096 (log=2)

Fragment size=4096 (log=2)

Stride=0 blocks, Stripe width=0 blocks

13107200 inodes, 52428800 blocks

2621440 blocks (5.00%) reserved for the super user

First data block=0

Maximum filesystem blocks=4294967296

1600 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, 7962624, 11239424, 20480000, 23887872

Allocating group tables: done

Writing inode tables: done

Creating journal (32768 blocks): done

Writing superblocks and filesystem accounting information: done

[root@qianliyan4g1 ~]#

[root@qianliyan4g1 ~]#

[root@qianliyan4g1 ~]#

[root@qianliyan4g1 ~]# fdisk -l

Disk /dev/vda: 21.5 GB, 21474836480 bytes, 41943040 sectors

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk label type: dos

Disk identifier: 0x000b9a2e

Device Boot Start End Blocks Id System

/dev/vda1 * 2048 41929649 20963801 83 Linux

Disk /dev/vdb: 214.7 GB, 214748364800 bytes, 419430400 sectors

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

[root@qianliyan4g1 ~]# mount /dev/vdb /home

[root@qianliyan4g1 ~]# df -l

Filesystem 1K-blocks Used Available Use% Mounted on

/dev/vda1 20503592 2323672 17220344 12% /

devtmpfs 8126016 0 8126016 0% /dev

tmpfs 8134416 0 8134416 0% /dev/shm

tmpfs 8134416 416 8134000 1% /run

tmpfs 8134416 0 8134416 0% /sys/fs/cgroup

/dev/vdb 206293688 60816 195747112 1% /home

[root@qianliyan4g1 ~]#

[root@qianliyan4g1 ~]#

[root@qianliyan4g1 ~]#

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值