Linux CentOS7.3磁盘挂载

  1. fdisk -l
    在这里插入图片描述

  2. [root@driver ~]# fdisk /dev/vdb

Welcome to fdisk (util-linux 2.23.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): n
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-4194303999, default 2048): 
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-4194303999, default 4194303999): 
Using default value 4194303999
Partition 1 of type Linux and of size 2 TiB is set

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

  1. [root@driver ~]# mkfs.ext4 /dev/vdb1
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
131072000 inodes, 524287744 blocks
26214387 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=2671771648
16000 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, 71663616, 78675968, 
	102400000, 214990848, 512000000

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done 
  1. [root@driver ~]# mount /dev/vdb1
[root@driver ~]# df
Filesystem      1K-blocks     Used  Available Use% Mounted on
/dev/vda1        41931756 12220280   29711476  30% /
devtmpfs           498432        0     498432   0% /dev
tmpfs              508192        0     508192   0% /dev/shm
tmpfs              508192     6672     501520   2% /run
tmpfs              508192        0     508192   0% /sys/fs/cgroup
tmpfs              101640        0     101640   0% /run/user/0
/dev/vdb1      2064103824    81944 1959147948   1% /home

  1. 查看UUID
[root@driver ~]# sudo blkid /dev/vdb1
/dev/vdb1: UUID="bb40c14e-2b1b-4bfc-aa0a-xxxxxxxxxx" TYPE="ext4" 
  1. 编辑
[root@driver ~]# vim /etc/fstab


#
# /etc/fstab
# Created by anaconda on Fri Jan 26 04:08:32 2018
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#

UUID="bb40c14e-2b1b-4bfc-aa0a-7c620b67a6d4 /home
/dev/vdb1 /home ext4 default 0 1

  1. 如果想删除之前建立的分区
[root@driver ~]# fdisk /dev/vdb
Welcome to fdisk (util-linux 2.23.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): d
Selected partition 1
Partition 1 is deleted

Command (m for help): w
The partition table has been altered!

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值