RAID与磁盘管理之——综合应用
为了实现磁盘的管理和RAID的综合,现将四块硬盘组合成一个RAID10,并在此基础之上创建物理卷、卷组、逻辑卷,实现在线扩容,最后挂载使用。
其中也部分包含了swap分区的创建和使用。
1、根据linux系统下,一切皆文件的特性。硬盘在linux中识别为文件,分区也是识别为文件,因此在liunx系统之中用一块磁盘的四个主分区(主分区最多四个)模拟成四块SCSI硬盘。
首先进行四个主分区的创建:
Welcome to fdisk (util-linux 2.23.2).
Be careful before using the write command.
Building a new DOS disklabel with disk identifier 0xdbd4718a.
Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select (default p):
Using default response p
Partition number (1-4, default 1):
First sector (2048-20971519, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-20971519, default 20971519): +2500M
Partition 1 of type Linux and of size 2.5 GiB is set
Partition type:
p primary (1 primary, 0 extended, 3 free)
e extended
Select (default p):
Using default response p
Partition number (2-4, default 2):
First sector (5122048-20971519, default 5122048):
Using default value 5122048
Last sector, +sectors or +size{K,M,G} (5122048-20971519, default 20971519): +2500M
Partition 2 of type Linux and of size 2.5 GiB is set
Partition type:
p primary (2 primary, 0 extended, 2 free)
e extended
Select (default p):
Using default response p
Partition number (3,4, default 3):
First sector (10242048-20971519, default 10242048):
Using default value 10242048
Last sector, +sectors or +size{K,M,G} (10242048-20971519, default 20971519): +2500M
Partition 3 of type Linux and of size 2.5 GiB is set
Partition type:
p primary (3 primary, 0 extended, 1 free)
e extended
Select (default e): p
Selected partition 4
First sector (15362048-20971519, default 15362048):
Using default value 15362048
Last sector, +sectors or +size{K,M,G} (15362048-20971519, default 20971519):
Using default value 20971519
Partition 4 of type Linux and of size 2.7 GiB is set
The partition table has been altered!
Syncing disks.
/dev/sdb /dev/sdb1 /dev/sdb2 /dev/sdb3 /dev/sdb4
[root@localhost ~]# rpm -q mdadm
mdadm-3.4-14.el7.x86_64
mdadm: largest drive (/dev/sdb4) exceeds size (2557952K) by more than 1%
Continue creating array? y
mdadm: Defaulting to version 1.2 metadata
mdadm: array /dev/md/md_10 started.
[root@localhost md]# ls
md_10
Physical volume "/dev/md/md_10" successfully created.
[root@localhost dev]# vgcreate /dev/vg_10 /dev/md/md_10
Volume group "vg_10" successfully created
Logical volume "lv_10" created.
[root@localhost vg_10]# ls
lv_10
meta-data=/dev/vg_10/lv_10 isize=512 agcount=8, agsize=31872 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=0, sparse=0
data = bsize=4096 blocks=254976, imaxpct=25
= sunit=128 swidth=256 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=1
log =internal log bsize=4096 blocks=624, version=2
= sectsz=512 sunit=8 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
[root@localhost ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 8.7G 4.7G 4.1G 54% /
devtmpfs 474M 0 474M 0% /dev
tmpfs 489M 84K 489M 1% /dev/shm
tmpfs 489M 7.1M 482M 2% /run
tmpfs 489M 0 489M 0% /sys/fs/cgroup
/dev/sda1 297M 152M 146M 51% /boot
tmpfs 98M 0 98M 0% /run/user/0
tmpfs 98M 16K 98M 1% /run/user/42
/dev/mapper/vg_10-lv_10 994M 33M 962M 4% /md_mount
lrwxrwxrwx 1 root root 7 Jul 14 18:48 /dev/mapper/vg_10-lv_10 -> ../dm-0
Size of logical volume vg_10/lv_10 changed from 1000.00 MiB (250 extents) to 1.95 GiB (500 extents).
Logical volume vg_10/lv_10 successfully resized.
meta-data=/dev/mapper/vg_10-lv_10 isize=512 agcount=8, agsize=31872 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=0 spinodes=0
data = bsize=4096 blocks=254976, imaxpct=25
= sunit=128 swidth=256 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=1
log =internal bsize=4096 blocks=624, version=2
= sectsz=512 sunit=8 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
data blocks changed from 254976 to 512000
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 8.7G 4.7G 4.1G 54% /
devtmpfs 474M 0 474M 0% /dev
tmpfs 489M 84K 489M 1% /dev/shm
tmpfs 489M 7.1M 482M 2% /run
tmpfs 489M 0 489M 0% /sys/fs/cgroup
/dev/sda1 297M 152M 146M 51% /boot
tmpfs 98M 0 98M 0% /run/user/0
tmpfs 98M 16K 98M 1% /run/user/42
/dev/mapper/vg_10-lv_10 2.0G 33M 2.0G 2% /md_mount
7、swap交换分区
512+0 records in
512+0 records out
536870912 bytes (537 MB) copied, 8.01682 s, 67.0 MB/s
[root@localhost ~]# mkswap /swap/swap
Setting up swapspace version 1, size = 524284 KiB
no label, UUID=49054206-a32f-443e-b87b-22619a2aead4
total used free shared buff/cache available
Mem: 976M 239M 71M 7.1M 665M 553M
Swap: 1.0G 0B 1.0G
[root@localhost ~]# swapon /swap/swap
swapon: /swap/swap: insecure permissions 0644, 0600 suggested.
[root@localhost ~]# chmod 600 /swap/swap
[root@localhost ~]# free -h
total used free shared buff/cache available
Mem: 976M 239M 68M 7.1M 668M 553M
Swap: 1.5G 0B 1.5G
RAID与磁盘管理之——综合应用的更多相关文章
- 使用RAID进行磁盘管理
转自http://www.linuxprobe.com/chapter-06/ 磁盘阵列(Redundant Arrays of Independent Disks,RAID),有“独立磁盘构成的具有 ...
- 每天进步一点点——Linux磁盘管理LVM与RAID
转载请注明出处:http://blog.csdn.net/cywosp/article/details/38965799 1. 传统磁盘管理问题 当分区大小不够用时无法扩展其大小,仅仅能通过加入硬盘. ...
- linux磁盘管理系列-软RAID的实现
1 什么是RAID RAID全称是独立磁盘冗余阵列(Redundant Array of Independent Disks),基本思想是把多个磁盘组合起来,组合一个磁盘阵列组,使得性能大幅提高. R ...
- linux磁盘管理系列二:软RAID的实现
磁盘管理系列 linux磁盘管理系列一:磁盘配额管理 http://www.cnblogs.com/zhaojiedi1992/p/zhaojiedi_linux_040_quota.html l ...
- Linux RAID 磁盘管理
Linux RAID 磁盘管理 RAID工作模式介绍:https://www.cnblogs.com/xiangsikai/p/8441440.html 本章主要讲解 Linux下 RAID5 与 R ...
- liunx 磁盘管理命令记录
Linux磁盘管理好坏管理直接关系到整个系统的性能问题. Linux磁盘管理常用三个命令为df.du和fdisk. df:列出文件系统的整体磁盘使用量 du:检查磁盘空间使用量 fdisk:用于磁盘分 ...
- LVM磁盘管理
http://www.cnblogs.com/gaojun/archive/2012/08/22/2650229.html Linux LVM硬盘管理及LVM扩容 LVM磁盘管理 一.LVM简介... ...
- linux磁盘管理系列-LVM的使用
LVM是什么 LVM是Linux操作系统的逻辑卷管理器. 现在有两个Linux版本的LVM,分别是 LVM1,LVM2.LVM1是一种已经被认为稳定了几年的成熟产品,LVM2 是最新最好的LVM版本. ...
- Linux第七节随笔-下磁盘管理
baidubaike 磁盘管理物理磁盘---> RAID--->文件系统--->用户使用LVM概念简述Raid详细解说 0 ...
随机推荐
- Pandas 性能优化 学习笔记
摘要 本文介绍了使用 Pandas 进行数据挖掘时常用的加速技巧. 实验环境 import numpy as np import pandas as pd print(np.__version__) ...
- 陶陶摘苹果(0)<P2005_1>
陶陶摘苹果 (apple.pas/c/cpp) [问题描述] 陶陶家的院子里有一棵苹果树,每到秋天树上就会结出10个苹果.苹果成熟的时候,陶陶就会跑去摘苹果.陶陶有个30厘米高的板凳,当她不能直接用 ...
- VIM 练级
https://coolshell.cn/articles/5426.html
- 第四周之Hadoop学习(四)
上周已经成功完成了Hadoop的学习,这周则是搭建好Hadoop的安卓编程环境 今天的学习根据这篇博客:https://blog.csdn.net/HcJsJqJSSM/article/details ...
- springboot 跨域
参考: https://blog.csdn.net/qq779446849/article/details/53102925 https://blog.csdn.net/wo541075754/art ...
- 3_04_MSSQL课程_Ado.Net_.ExcuteReader()(SQLDataReader)
ExcuteNonQuery(); 返回影响的行数 ExcuteSacalar();返回第一行第一列 ExcuteReader(): Reader,指针,指向表的表头.只是指向,数据仍在数据库中. S ...
- 常见Linux发行版有哪些?
Linux 发行版(英语:Linux distribution,也被叫做GNU/Linux 发行版),为一般用户预先集成好的Linux操作系统及各种应用软件.一般用户不需要重新编译,在直接安装之后,只 ...
- ORACLE 判断首字母大小写问题
1.对判断的字段进行拆分 select substr(要区分的字段,0,1) from 表 : 得到一个 首字母 2.对这个字符进行大小写判断 查出以小写字符为开头的 select substr ...
- Systemverilog for design 笔记(三)
转载请标明出处 用户自定义和枚举数据类型 1. 用户自定义类型(typedef) 局部typedef定义:只用于设计的特定部分时,typedef的定义可在module或interface中 共享typ ...
- 「Violet」蒲公英
「Violet」蒲公英 传送门 区间众数,强制在线. 分块经典题. 像这题一样预处理,然后就直接爆搞,复杂度 \(O(n \sqrt n)\) 参考代码: #include <algorithm ...