[root@fcar-service2 ~]# fdisk -l 查看数据盘盘符
Disk /dev/vda: 53.7 GB, 53687091200 bytes, 104857600 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: 0x000b2d99
Device Boot Start End Blocks Id System
/dev/vda1 * 2048 104856254 52427103+ 83 Linux
Disk /dev/vdb: 268.4 GB, 268435456000 bytes, 524288000 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@fcar-service2 ~]#
[root@fcar-service2 ~]# fdisk -u /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.
Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0x7e93db5f.
Command (m for help): p
Disk /dev/vdb: 268.4 GB, 268435456000 bytes, 524288000 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: 0x7e93db5f
Device Boot Start End Blocks Id System
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-524287999, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-524287999, default 524287999):
Using default value 524287999
Partition 1 of type Linux and of size 250 GiB is set
Command (m for help): p
Disk /dev/vdb: 268.4 GB, 268435456000 bytes, 524288000 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: 0x7e93db5f
Device Boot Start End Blocks Id System
/dev/vdb1 2048 524287999 262142976 83 Linux
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
[root@fcar-service2 ~]#
[root@fcar-service2 ~]#
[root@fcar-service2 ~]#
[root@fcar-service2 ~]# fdisk -lu /dev/vdb
Disk /dev/vdb: 268.4 GB, 268435456000 bytes, 524288000 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: 0x7e93db5f
Device Boot Start End Blocks Id System
/dev/vdb1 2048 524287999 262142976 83 Linux
[root@fcar-service2 ~]#
[root@fcar-service2 ~]#
[root@fcar-service2 ~]# 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
16384000 inodes, 65535744 blocks
3276787 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=2214592512
2000 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@fcar-service2 ~]#
[root@fcar-service2 ~]#
[root@fcar-service2 ~]#
[root@fcar-service2 ~]# cat /etc/fstab
#
# /etc/fstab
# Created by anaconda on Thu Jul 11 02:52:01 2019
#
# 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=1114fe9e-2309-4580-b183-d778e6d97397 / ext4 defaults 1 1
[root@fcar-service2 ~]# cp -p /etc/fstab /etc/fstab.200619
[root@fcar-service2 ~]# ll /etc/fst*
-rw-r–r-- 1 root root 313 Jul 11 2019 /etc/fstab
-rw-r–r-- 1 root root 313 Jul 11 2019 /etc/fstab.200619
[root@fcar-service2 ~]#
[root@fcar-service2 ~]#
[root@fcar-service2 ~]#
[root@fcar-service2 ~]# echo `blkid /dev/vdb1 | awk '{print $2}' | sed 's/\"//g'`
UUID=0c48cfcf-87fe-4782-8127-76287be815db
[root@fcar-service2 ~]# blkid
/dev/vdb1: UUID=“0c48cfcf-87fe-4782-8127-76287be815db” TYPE=“ext4”
/dev/vda1: UUID=“1114fe9e-2309-4580-b183-d778e6d97397” TYPE=“ext4” PTTYPE=“dos”
[root@fcar-service2 ~]#
[root@fcar-service2 ~]#
[root@fcar-service2 ~]#
[root@fcar-service2 ~]# cd /
[root@fcar-service2 /]# mkdir data #创建data目录
[root@fcar-service2 /]# ll
total 64
lrwxrwxrwx. 1 root root 7 Jul 11 2019 bin -> usr/bin
dr-xr-xr-x. 5 root root 4096 Jul 11 2019 boot
drwxr-xr-x 2 root root 4096 Jun 19 09:12 data
drwxr-xr-x 19 root root 3000 Jun 19 09:01 dev
drwxr-xr-x. 77 root root 4096 Jun 19 09:07 etc
drwxr-xr-x. 2 root root 4096 Apr 11 2018 home
lrwxrwxrwx. 1 root root 7 Jul 11 2019 lib -> usr/lib
lrwxrwxrwx. 1 root root 9 Jul 11 2019 lib64 -> usr/lib64
drwx------. 2 root root 16384 Jul 11 2019 lost+found
drwxr-xr-x. 2 root root 4096 Apr 11 2018 media
drwxr-xr-x. 2 root root 4096 Apr 11 2018 mnt
drwxr-xr-x. 2 root root 4096 Apr 11 2018 opt
dr-xr-xr-x 101 root root 0 Jun 19 08:49 proc
dr-xr-x---. 5 root root 4096 Jun 19 06:37 root
drwxr-xr-x 24 root root 660 Jun 19 09:09 run
lrwxrwxrwx. 1 root root 8 Jul 11 2019 sbin -> usr/sbin
drwxr-xr-x. 2 root root 4096 Apr 11 2018 srv
dr-xr-xr-x 13 root root 0 Jun 19 08:49 sys
drwxrwxrwt. 9 root root 4096 Jun 19 08:49 tmp
drwxr-xr-x. 13 root root 4096 Jul 11 2019 usr
drwxr-xr-x. 19 root root 4096 Jul 11 2019 var
[root@fcar-service2 /]#
[root@fcar-service2 /]# echo `blkid /dev/vdb1 | awk '{print $2}' | sed 's/\"//g'` /data ext4 defaults 0 0 >> /etc/fstab
[root@fcar-service2 ~]#
[root@fcar-service2 ~]# cat /etc/f
favicon.png filesystems firewalld/ fstab fstab.200619
[root@fcar-service2 ~]# cat /etc/fstab
#
# /etc/fstab
# Created by anaconda on Thu Jul 11 02:52:01 2019
#
# 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=1114fe9e-2309-4580-b183-d778e6d97397 / ext4 defaults 1 1
UUID=0c48cfcf-87fe-4782-8127-76287be815db /data ext4 defaults 0 0
[root@fcar-service2 ~]#
[root@fcar-service2 ~]#
[root@fcar-service2 /]# mount /dev/vdb1 /data
[root@fcar-service2 /]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/vda1 50G 1.7G 46G 4% /
devtmpfs 7.8G 0 7.8G 0% /dev
tmpfs 7.8G 0 7.8G 0% /dev/shm
tmpfs 7.8G 484K 7.8G 1% /run
tmpfs 7.8G 0 7.8G 0% /sys/fs/cgroup
tmpfs 1.6G 0 1.6G 0% /run/user/0
/dev/vdb1 246G 61M 234G 1% /data
[root@fcar-service2 carnet]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/vda1 50G 1.7G 46G 4% /
devtmpfs 7.8G 0 7.8G 0% /dev
tmpfs 7.8G 0 7.8G 0% /dev/shm
tmpfs 7.8G 484K 7.8G 1% /run
tmpfs 7.8G 0 7.8G 0% /sys/fs/cgroup
tmpfs 1.6G 0 1.6G 0% /run/user/0
/dev/vdb1 246G 380M 234G 1% /data