磁盘格式化

IT
IT
IT
335
文章
1
评论
2020年3月22日16:19:22 评论 943 2202字阅读7分20秒

查看磁盘信息

[root@iZ2ze8dv3a3meoltm5u25oZ ~]# fdisk -l
 
Disk /dev/vda: 42.9 GB, 42949672960 bytes, 83886080 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: 0x000aaa23
 
   Device Boot      Start         End      Blocks   Id  System
/dev/vda1   *        2048    83875364    41936658+  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@iZ2ze8dv3a3meoltm5u25oZ ~]# 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.
 
Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0xdfad3836.
 
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-419430399, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-419430399, default 419430399):
Using default value 419430399
Partition 1 of type Linux and of size 200 GiB is set
 
Command (m for help): wq
The partition table has been altered!
 
Calling ioctl() to re-read partition table.
Syncing disks.

格式化

[root@iZ2ze8dv3a3meoltm5u25pZ ~]# 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
13107200 inodes, 52428544 blocks
2621427 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=2199912448
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

磁盘挂载,在/home目录下

[root@iZ2ze8dv3a3meoltm5u25pZ ~]# echo /dev/vdb1 /home ext4 defaults 0 0 >> /etc/fstab

重启系统验证

[root@iZ2ze8dv3a3meoltm5u25oZ ~]# df -h
Filesystem      Size  Used Avail Use% Mounted on
devtmpfs        3.7G     0  3.7G   0% /dev
tmpfs           3.7G     0  3.7G   0% /dev/shm
tmpfs           3.7G  440K  3.7G   1% /run
tmpfs           3.7G     0  3.7G   0% /sys/fs/cgroup
/dev/vda1        40G  1.8G   36G   5% /
/dev/vdb1       197G   61M  187G   1% /home
tmpfs           756M     0  756M   0% /run/user/0
继续阅读
  • 我的QQ
  • QQ扫一扫
  • weinxin
  • 我的头条
  • 头条扫一扫
  • weinxin
CentOS 最后更新:2020-3-27
IT
  • 本文由 发表于 2020年3月22日16:19:22
  • 除非特殊声明,本站文章均为原创,转载请务必保留本文链接
Eureka同步到nacos Nacos

Eureka同步到nacos

官方介绍文档地址 https://nacos.io/zh-cn/docs/nacos-sync.html 官方安装文档地址 https://nacos.io/zh-cn/docs/nacos-sync...
Eureka指定应用的instanceId为IP CentOS

Eureka指定应用的instanceId为IP

痛点 现在所有的应用指定的是服务器默认机器名称,对查看是哪一个服务IP或者单节点自动剔除服务不友好。 像如上图所示,想知道是哪一个节点,还得点开才能获取IP。 改造 全部改成自动获取服务器IP为ins...
阿里云网盘 CentOS

阿里云网盘

申请内测地址 https://survey.aliyun.com/apps/zhiliao/_o6XQjioM 官网地址 https://www.teambition.com/products/pan...
GitLab或Jenkins集成构建工具 CentOS

GitLab或Jenkins集成构建工具

集成构建工具 构建工具是用来将代码编译打包成制品的工具。例如前端项目我们一般使用npm进行打包,后端java项目我们一般使用maven、gradle进行打包。构建工具很多很多,但是集成到gitlab中...