自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

磁盤及文件系統(tǒng)管理應(yīng)用實(shí)例

存儲(chǔ) 存儲(chǔ)設(shè)備
RAID(冗余磁盤陣列)是將多塊磁盤當(dāng)做一塊物理磁盤來使用,以達(dá)到容錯(cuò)或者提高讀寫性能的優(yōu)勢(shì)。按照 組織起來的工作方式的不同,我們可以將RAID分為不同的級(jí)別,其中常見的有RAID0、RAID1、RAID5、RAID10.

1.創(chuàng)建一個(gè)10G的分區(qū),并格式化為ext4文件系統(tǒng)

要求其block大小為2048,預(yù)留空間百分比為2,卷標(biāo)為MYDATA,默認(rèn)掛載屬性包含acl

掛載至/data/mydata目錄,要求掛載時(shí)禁止程序自動(dòng)運(yùn)行,且不更新文件的訪問時(shí)間戳

[[200320]]

  1. [root@master ~]# fdisk /dev/sdb  
  2. Command (m for help): n  
  3. Partition type:  
  4. primary (0 primary, 0 extended, 4 free 
  5. e extended  
  6. Select (default p): p  
  7. Partition number (1-4, default 1): 1  
  8. First sector (2048-41943039, default 2048):  
  9. Using default value 2048  
  10. Last sector, +sectors or +size{K,M,G} (2048-41943039, default 41943039): +10G  
  11. Partition 1 of type Linux and of size 10 GiB is set  
  12. Command (m for help): w  
  13. The partition table has been altered!  
  14. [root@master ~]# mke2fs -t ext4 -b 2048 -m 2 -L MYDATA /dev/sdb1  
  15. [root@master ~]# tune2fs -o acl /dev/sdb1  
  16. [root@master ~]# mount -o noexec,noatime /dev/sdb1 /data/mydata 

2.創(chuàng)建一個(gè)大小為1G的swap分區(qū),并創(chuàng)建好文件系統(tǒng),并啟用之,寫一個(gè)腳本

獲取并列出當(dāng)前系統(tǒng)上的所有磁盤設(shè)備

顯示每個(gè)磁盤設(shè)備上每個(gè)分區(qū)的相關(guān)的空間使用信息

  1. Last sector, +sectors or +size{K,M,G} (20973568-41943039, default 41943039): +1G 
  2. Partition 2 of type Linux and of size 1 GiB is set 
  3. Command (m for help): t 
  4. Partition number (1,2, default 2): 2 
  5. Hex code (type L to list all codes): L 
  6. Hex code (type L to list all codes): 82 
  7. Changed type of partition 'Linux' to 'Linux swap / Solaris' 
  8. Command (m for help): w 
  9. The partition table has been altered! 
  10. [root@master ~]# mkswap -L SWAP /dev/sdb2 
  11. [root@master ~]# swapon /dev/sdb2 
  12. #!/bin/bash 
  13. disks=`fdisk -l|grep -o '^Disk /dev/[sh]d[a-z]'|cut -d' ' -f2` 
  14. echo $disks 
  15. for i in $disks;do 
  16. fdisk -l $i 
  17. done 

3.總結(jié)RAID的各個(gè)級(jí)別及其組合方式和性能的不同

RAID(冗余磁盤陣列)是將多塊磁盤當(dāng)做一塊物理磁盤來使用,以達(dá)到容錯(cuò)或者提高讀寫性能的優(yōu)勢(shì)。按照 組織起來的工作方式的不同,我們可以將RAID分為不同的級(jí)別,其中常見的有RAID0、RAID1、RAID5、RAID10

RAID0

俗稱條帶卷,實(shí)現(xiàn)將文件分成多個(gè)chunk后同時(shí)并行存儲(chǔ)到多個(gè)盤中。

特性

讀寫性能得到提升

無冗余能力

最少磁盤數(shù)為2

可用空間為容量最小的磁盤*磁盤數(shù)

RAID1

俗稱鏡像卷,在存儲(chǔ)數(shù)據(jù)的同時(shí)需要再?gòu)?fù)制一份存入另一個(gè)磁盤中。

特性

讀性能提升,寫性能下降

有冗余能力

最少磁盤數(shù)為2,偶數(shù)

可用空間小于1/2

RAID5

將文件分成多個(gè)chunk,兩兩chunk之間作異或運(yùn)算,各盤輪流存儲(chǔ)校驗(yàn)碼

特點(diǎn)

讀寫性能提升

有冗余能力

最少磁盤數(shù)為3

可用空間為容量最小的磁盤*(磁盤數(shù)-1)

RAID10

先兩兩做raid1,后將多組raid1組織成raid0

特點(diǎn)

讀寫性能提升

有冗余能力

最小磁盤數(shù)4

可用空間為容量最小的磁盤*磁盤數(shù)/2

4.創(chuàng)建一個(gè)大小為10G的RAID1,要求有一個(gè)空閑盤,而且chunk大小為128k

  1. [root@master ~]# fdisk /dev/sdb 
  2. Command (m for help): n 
  3. Partition type: 
  4. primary (1 primary, 0 extended, 3 free
  5. e extended 
  6. Select (default p): p 
  7. Partition number (2-4, default 2): 2 
  8. First sector (20973568-41943039, default 20973568): 
  9. Using default value 20973568 
  10. [root@master ~]# fdisk /dev/sdb 
  11. Command (m for help): n 
  12. Partition type: 
  13. primary (0 primary, 0 extended, 4 free
  14. e extended 
  15. Select (default p): p 
  16. Partition number (1-4, default 1): 1 
  17. First sector (2048-104857599, default 2048): 
  18. Using default value 2048 
  19. Last sector, +sectors or +size{K,M,G} (2048-104857599, default 104857599): +10G 
  20. Partition 1 of type Linux and of size 10 GiB is set 
  21. Command (m for help): n 
  22. Partition type: 
  23. primary (1 primary, 0 extended, 3 free
  24. e extended 
  25. Select (default p): p 
  26. Partition number (2-4, default 2): 2 
  27. First sector (20973568-104857599, default 20973568): +10G 
  28. Value out of range. 
  29. First sector (20973568-104857599, default 20973568): 
  30. Using default value 20973568 
  31. Last sector, +sectors or +size{K,M,G} (20973568-104857599, default 104857599): +10G 
  32. Partition 2 of type Linux and of size 10 GiB is set 
  33. Command (m for help): n 
  34. Partition type: 
  35. primary (2 primary, 0 extended, 2 free
  36. e extended 
  37. Select (default p): p 
  38. Partition number (3,4, default 3): 3 
  39. First sector (41945088-104857599, default 41945088): 
  40. Using default value 41945088 
  41. Last sector, +sectors or +size{K,M,G} (41945088-104857599, default 104857599): +10G 
  42. Partition 3 of type Linux and of size 10 GiB is set 
  43. Command (m for help): t 
  44. Partition number (1-3, default 3): 1 
  45. Hex code (type L to list all codes): fd 
  46. Changed type of partition 'Linux' to 'Linux raid autodetect' 
  47. Command (m for help): t 
  48. Partition number (1-3, default 3): 2 
  49. Hex code (type L to list all codes): fd 
  50. Changed type of partition 'Linux' to 'Linux raid autodetect' 
  51. Command (m for help): t 
  52. Partition number (1-3, default 3): 3 
  53. Hex code (type L to list all codes): fd 
  54. Changed type of partition 'Linux' to 'Linux raid autodetect' 
  55. Command (m for help): w 
  56. The partition table has been altered! 
  57. [root@master ~]# mdadm -C /dev/md0 -n 2 -c 128 -x 1 -l 1 -a yes /dev/sdb{1,2,3} 
  58. mdadm: Defaulting to version 1.2 metadata 
  59. mdadm: array /dev/md0 started. 

5.創(chuàng)建一個(gè)大小為4G的RAID5設(shè)備,chunk大小為256k,格式化ext4文件系統(tǒng),要求可開機(jī)自動(dòng)掛載至/backup目錄,且不更新訪問時(shí)間戳,且支持acl功

  1. “` 
  2. [root@master ~]# fdisk /dev/sdb 
  3. Command (m for help): n 
  4. All primary partitions are in use 
  5. Adding logical partition 5 
  6. First sector (62918656-104857599, default 62918656): 
  7. Using default value 62918656 
  8. Last sector, +sectors or +size{K,M,G} (62918656-104857599, default 104857599): +2G 
  9. Partition 5 of type Linux and of size 2 GiB is set 
  10. Command (m for help): n 
  11. All primary partitions are in use 
  12. Adding logical partition 6 
  13. First sector (67115008-104857599, default 67115008): 
  14. Using default value 67115008 
  15. Last sector, +sectors or +size{K,M,G} (67115008-104857599, default 104857599): +2G 
  16. Partition 6 of type Linux and of size 2 GiB is set 
  17. Command (m for help): n 
  18. All primary partitions are in use 
  19. Adding logical partition 7 
  20. First sector (71311360-104857599, default 71311360): 
  21. Using default value 71311360 
  22. Last sector, +sectors or +size{K,M,G} (71311360-104857599, default 104857599): +2G 
  23. Partition 7 of type Linux and of size 2 GiB is set 
  24. Command (m for help): w 
  25. The partition table has been altered! 
  26. [root@master ~]# mdadm -C /dev/md1 -n 3 -c 256 -l 5 -a yes /dev/sdb{5,6,7} 
  27. mdadm: Defaulting to version 1.2 metadata 
  28. mdadm: array /dev/md1 started. 
  29. [root@master ~]# mke2fs -t ext4 /dev/md1 
  30. [root@master ~]# mkdir /backup 
  31. [root@master ~]# mount -o auto /dev/md1 /backup 
責(zé)任編輯:武曉燕 來源: 運(yùn)維部落
相關(guān)推薦

2009-10-12 11:14:51

LinuxLinux磁盤文件系統(tǒng)管理

2010-04-07 18:42:42

Unix命令

2009-10-13 14:31:26

:Linux系統(tǒng)磁盤系統(tǒng)管理

2009-02-25 11:53:23

文件管理POSIX備份

2010-01-14 17:05:42

MySQL CentO

2013-09-18 10:57:09

虛擬化應(yīng)用

2010-05-05 15:56:37

Unix系統(tǒng)

2014-01-13 10:02:11

虛擬化系統(tǒng)管理

2010-05-04 15:22:25

Unix系統(tǒng)

2011-09-01 13:42:15

優(yōu)化布線系統(tǒng)管理布線系統(tǒng)

2010-05-05 16:27:22

Unix系統(tǒng)

2013-08-22 10:15:32

應(yīng)用性能監(jiān)控系統(tǒng)管理

2013-05-09 09:27:46

2013-05-02 14:06:30

Android開發(fā)用戶系統(tǒng)管理

2017-03-27 09:30:14

Linux系統(tǒng)管理技巧

2011-11-23 10:21:44

思科云計(jì)算IaaS

2010-05-07 17:16:36

Unix系統(tǒng)

2011-11-17 16:06:45

IT系統(tǒng)管理

2009-07-11 16:04:04

布線系統(tǒng)管理優(yōu)化

2012-02-29 00:57:41

Linux系統(tǒng)
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)