LINUX学生会

磁盘配额与RAID管理

2017-06-25  本文已影响23人  尘曦的雨

磁盘配额管理

先划分分区,使用fdisk划分分区

创建文件系统

迁移用户家目录

mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
655776 inodes, 2622603 blocks
131130 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=2688548864
81 block groups
32768 blocks per group, 32768 fragments per group
8096 inodes per group
Superblock backups stored on blocks: 
    32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632

Writing inode tables: 16done                            
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 36 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override
edquota: Cannot open quotafile /home/aquota.user: Permission denied
Disk quotas for user cx (uid 501):
  Filesystem                   blocks  以用的空间    soft 软的空间大小设置      hard  硬限制的空间大小   inodes inodes节点的使用   soft节点的软设置     hard节点的硬设置
  /dev/sdc1                        36                 0                         0                       9                       0                0
  /dev/sdd1                         0          0          0          0        0        0

RAID 管理

什么是RAID

RAID:Redundant Arrays of Inexpensive( (Independent) ) Disks

1988 年由加利福尼亚大学伯克利分校(University ofCalifornia-Berkeley))“ “A Case for RedundantArrays of Inexpensive Disks”

多个磁盘合成一个“阵列”来提供更好的性能、冗余,或者两者都提供

RAID

提高IO 能力:

磁盘并行读写

提高耐用性;

磁盘冗余来实现

级别:多块磁盘组织在一起的工作方式有所不同

RAID 实现的方式:

外接式磁盘阵列:通过扩展卡提供适配能力
内接式RAID :主板集成RAID 控制器
安装OS 前在BIOS 里配置
软件RAID :通过OS

RAID级别

RAID-0 :条带卷,strip

RAID-1: 镜像卷,mirror

RAID-2

RAID-5

RAID-10

RAID-01

RAID-0:
RAID-1:
RAID-4:
RAID-5:
RAID-6:
RAID-10:
RAID-01 、RAID-50
RAID7: 可以理解为一个独立存储计算机,自身带有操作系统和管理工具,可以独立运行,理论上性能最高的RAID 模式
JBOD :Just a Bunch Of Disks
功能:将多块磁盘的空间合并一个大的连续空间使用
常用级别:RAID-0, RAID-1, RAID-5, RAID-10,RAID-50, JBOD

软RAID

RAID的实现

查看磁盘分区情况

NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda      8:0    0  200G  0 disk 
├─sda1   8:1    0   10G  0 part /boot
├─sda2   8:2    0 97.7G  0 part /
├─sda3   8:3    0 48.8G  0 part 
├─sda4   8:4    0    1K  0 part 
├─sda5   8:5    0    2G  0 part [SWAP]
├─sda6   8:6    0   10G  0 part 
└─sda7   8:7    0   10G  0 part 
sdb      8:16   0  200G  0 disk 
├─sdb1   8:17   0   30G  0 part 
├─sdb2   8:18   0   30G  0 part 
├─sdb3   8:19   0   30G  0 part 
└─sdb4   8:20   0   30G  0 part 
sdc      8:32   0   20G  0 disk 
└─sdc1   8:33   0   10G  0 part /home
sdd      8:48   0   60G  0 disk 
└─sdd1   8:49   0   20G  0 part 
sde      8:64   0   20G  0 disk 
sdf      8:80   0   20G  0 disk 
sr0     11:0    1  3.7G  0 rom  

[root@centos6 ~]# fdisk /dev/sdb

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
         sectors (command 'u').

Command (m for help): t
Partition number (1-4): 1
Hex code (type L to list codes): l

 0  Empty           24  NEC DOS         81  Minix / old Lin bf  Solaris        
 1  FAT12           39  Plan 9          82  Linux swap / So c1  DRDOS/sec (FAT-
 2  XENIX root      3c  PartitionMagic  83  Linux           c4  DRDOS/sec (FAT-
 3  XENIX usr       40  Venix 80286     84  OS/2 hidden C:  c6  DRDOS/sec (FAT-
 4  FAT16 <32M      41  PPC PReP Boot   85  Linux extended  c7  Syrinx         
 5  Extended        42  SFS             86  NTFS volume set da  Non-FS data    
 6  FAT16           4d  QNX4.x          87  NTFS volume set db  CP/M / CTOS / .
 7  HPFS/NTFS       4e  QNX4.x 2nd part 88  Linux plaintext de  Dell Utility   
 8  AIX             4f  QNX4.x 3rd part 8e  Linux LVM       df  BootIt         
 9  AIX bootable    50  OnTrack DM      93  Amoeba          e1  DOS access     
 a  OS/2 Boot Manag 51  OnTrack DM6 Aux 94  Amoeba BBT      e3  DOS R/O        
 b  W95 FAT32       52  CP/M            9f  BSD/OS          e4  SpeedStor      
 c  W95 FAT32 (LBA) 53  OnTrack DM6 Aux a0  IBM Thinkpad hi eb  BeOS fs        
 e  W95 FAT16 (LBA) 54  OnTrackDM6      a5  FreeBSD         ee  GPT            
 f  W95 Ext'd (LBA) 55  EZ-Drive        a6  OpenBSD         ef  EFI (FAT-12/16/
10  OPUS            56  Golden Bow      a7  NeXTSTEP        f0  Linux/PA-RISC b
11  Hidden FAT12    5c  Priam Edisk     a8  Darwin UFS      f1  SpeedStor      
12  Compaq diagnost 61  SpeedStor       a9  NetBSD          f4  SpeedStor      
14  Hidden FAT16 <3 63  GNU HURD or Sys ab  Darwin boot     f2  DOS secondary  
16  Hidden FAT16    64  Novell Netware  af  HFS / HFS+      fb  VMware VMFS    
17  Hidden HPFS/NTF 65  Novell Netware  b7  BSDI fs         fc  VMware VMKCORE 
18  AST SmartSleep  70  DiskSecure Mult b8  BSDI swap       fd  Linux raid auto
1b  Hidden W95 FAT3 75  PC/IX           bb  Boot Wizard hid fe  LANstep        
1c  Hidden W95 FAT3 80  Old Minix       be  Solaris boot    ff  BBT            
1e  Hidden W95 FAT1
Hex code (type L to list codes): fd
Changed system type of partition 1 to fd (Linux raid autodetect)

Command (m for help): t
Partition number (1-4): 2
Hex code (type L to list codes): fd
Changed system type of partition 2 to fd (Linux raid autodetect)

Command (m for help): t 
Partition number (1-4): 3
Hex code (type L to list codes): fd
Changed system type of partition 3 to fd (Linux raid autodetect)

Command (m for help): t
Partition number (1-4): 4
Hex code (type L to list codes): fd
Changed system type of partition 4 to fd (Linux raid autodetect)

Command (m for help): p

Disk /dev/sdb: 214.7 GB, 214748364800 bytes
255 heads, 63 sectors/track, 26108 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x41d1e5dc

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        3917    31463271   fd  Linux raid autodetect
/dev/sdb2            3918        7834    31463302+  fd  Linux raid autodetect
/dev/sdb3            7835       11751    31463302+  fd  Linux raid autodetect
/dev/sdb4           11752       15668    31463302+  fd  Linux raid autodetect

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
上一篇 下一篇

猜你喜欢

热点阅读