fdisk -l
整个操作日志如下:
[root@node1 ceph]# fdisk /dev/vdc
欢迎使用 fdisk (util-linux 2.23.2)。
更改将停留在内存中,直到您决定将更改写入磁盘。
使用写入命令前请三思。
Device does not contain a recognized partition table
使用磁盘标识符 0x3324f144 创建新的 DOS 磁盘标签。
命令(输入 m 获取帮助):m
命令操作
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
g create a new empty GPT partition table
G create an IRIX (SGI) partition table
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
命令(输入 m 获取帮助):n
Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select (default p): p
分区号 (1-4,默认 1):1
起始 扇区 (2048-41943039,默认为 2048):w
起始 扇区 (2048-41943039,默认为 2048):
将使用默认值 2048
Last 扇区, +扇区 or +size{K,M,G} (2048-41943039,默认为 41943039):
将使用默认值 41943039
分区 1 已设置为 Linux 类型,大小设为 20 GiB
命令(输入 m 获取帮助):w
The partition table has been altered!
Calling ioctl() to re-read partition table.
正在同步磁盘。
您在 /var/spool/mail/root 中有新邮件
[root@node1 ceph]# fdisk -l
磁盘 /dev/vda:42.9 GB, 42949672960 字节,83886080 个扇区
Units = 扇区 of 1 * 512 = 512 bytes
扇区大小(逻辑/物理):512 字节 / 512 字节
I/O 大小(最小/最佳):512 字节 / 512 字节
磁盘标签类型:dos
磁盘标识符:0x00006df4
设备 Boot Start End Blocks Id System
/dev/vda1 2048 6143 2048 83 Linux
/dev/vda2 * 6144 415743 204800 83 Linux
/dev/vda3 415744 8607743 4096000 82 Linux swap / Solaris
/dev/vda4 8607744 83886079 37639168 5 Extended
/dev/vda5 8609792 83886079 37638144 8e Linux LVM
磁盘 /dev/mapper/centos-root:38.5 GB, 38537265152 字节,75268096 个扇区
Units = 扇区 of 1 * 512 = 512 bytes
扇区大小(逻辑/物理):512 字节 / 512 字节
I/O 大小(最小/最佳):512 字节 / 512 字节
WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.
磁盘 /dev/vdb:107.4 GB, 107374182400 字节,209715200 个扇区
Units = 扇区 of 1 * 512 = 512 bytes
扇区大小(逻辑/物理):512 字节 / 512 字节
I/O 大小(最小/最佳):512 字节 / 512 字节
磁盘标签类型:gpt
# Start End Size Type Name
1 34 209713247 100G Microsoft basic primary
磁盘 /dev/vdc:21.5 GB, 21474836480 字节,41943040 个扇区
Units = 扇区 of 1 * 512 = 512 bytes
扇区大小(逻辑/物理):512 字节 / 512 字节
I/O 大小(最小/最佳):512 字节 / 512 字节
磁盘标签类型:dos
磁盘标识符:0x3324f144
设备 Boot Start End Blocks Id System
/dev/vdc1 2048 41943039 20970496 83 Linux
[root@node1 ceph]# mkfs -t ext4 -c /dev/vdc1
mke2fs 1.42.9 (28-Dec-2013)
文件系统标签=
OS type: Linux
块大小=4096 (log=2)
分块大小=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
1310720 inodes, 5242624 blocks
262131 blocks (5.00%) reserved for the super user
第一个数据块=0
Maximum filesystem blocks=2153775104
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
Checking for bad blocks (read-only test): done
Allocating group tables: 完成
正在写入inode表: 完成
Creating journal (32768 blocks): 完成
Writing superblocks and filesystem accounting information: 完成
[root@node1 ceph]# mkdir /data2
[root@node1 ceph]# ls
ceph.bootstrap-mds.keyring ceph.bootstrap-rgw.keyring ceph.conf ceph.mon.keyring
ceph.bootstrap-osd.keyring ceph.client.admin.keyring ceph.log rbdmap
[root@node1 ceph]# ls
ceph.bootstrap-mds.keyring ceph.bootstrap-rgw.keyring ceph.conf ceph.mon.keyring
ceph.bootstrap-osd.keyring ceph.client.admin.keyring ceph.log rbdmap
[root@node1 ceph]# mount -t ext4 /dev/vdc1 /data2
[root@node1 ceph]# df -l
文件系统 1K-块 已用 可用 已用% 挂载点
/dev/mapper/centos-root 37615672 26505692 11109980 71% /
devtmpfs 1930896 0 1930896 0% /dev
tmpfs 1941096 0 1941096 0% /dev/shm
tmpfs 1941096 204428 1736668 11% /run
tmpfs 1941096 0 1941096 0% /sys/fs/cgroup
/dev/vda2 201388 136492 64896 68% /boot
tmpfs 388220 0 388220 0% /run/user/0
/dev/vdb1 104805408 15935460 88869948 16% /data
/dev/vdc1 20510288 45080 19400300 1% /data2
[root@node1 ceph]# echo "/dev/vdc1 /data2 ext4 defaults 0 0" >> /etc/fstab
[root@node1 ceph]# cat /etc/fstab
#
# /etc/fstab
# Created by anaconda on Wed Mar 2 06:21:57 2016
#
# 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
#
/dev/mapper/centos-root / xfs defaults 0 0
UUID=02530cb6-cf81-48ef-8064-99c47f3562e1 /boot xfs defaults 0 0
UUID=cf92f135-657f-4e57-9098-d98f497bb6da swap swap defaults 0 0
/dev/vdc1 /data2 ext4 defaults 0 0
[root@node1 ceph]#