Linux Fundamentals 9

Source: Internet
Author: User

LVM logical Volumes
Logically combine multiple physical partitions/disks into a larger whole,
from which different logical partitions are divided, the size of the logical partitions can be enlarged as needed, reduced
!!!! /boot is used to store boot files and not to be created based on LVM

PV (physical volume)
Physical partitions, or entire physical disks, made up of PE (physical Extent, basic unit)
VG (Volume Group, Volume group)
Logical whole of one or more physical volumes
LV (Logical Volume, logical volume)
A piece of logical storage space split from a volume group that can be formatted to create a file system

LVM Common Commands
Feature Management physical volume management Volume Group Management Logical Volume
Scan scanning Pvscan Vgscan Lvscan
Create Pvcreate vgcreate lvcreate
Display displays Pvdisplay Vgdisplay lvdisplay
Remove delete pvremove vgremove lvremove
Extend extension vgextend lvextend
Reduce Vgreduce lvreduce
(Graphics Management Program: SYSTEM-CONFIG-LVM)


[[Email protected]~] #ls/dev/vdb* (View new disk)
/dev/vdb/dev/vdb1/dev/vdb2
[[Email protected]~] #pvscan (scan for physical volumes)
NO .....
[[Email protected]~] #pvcreate/dev/vdb[1-2] (one or two partitions of/dev/vdb to form a physical volume)
[[Email protected]~] #pvcan (scan physical volume)
....................
[[Email protected]~] #vgcreate Myvg/dev/vdb[1-2] (change the name of the volume group to MYVG)
...................
[[Email protected]~] #vgs (view basic MYVG information)
.....................
[[Email protected]~] #pvs (view basic information)
.....................
[[Email protected]~] #lvcreate-L 16g-n mylv MYVG (Creating a logical volume with the name Mylv,-n as the name MYVG the logical volume divided from the MYVG)
....................
[[Email protected]~] #ls/dev/myvg/mylv (view logical volume)
.....................
[Email protected]~] #mkfs. EXT4/DEV/MYVG/MYLV (Format the logical volume as a EXT4 file system)
[[Email protected]~] #mount/DEV/MYVG/MYLV/MYLVM (Attach it to MYLVM under the root)
.....................
[[Email protected]~] #vim/etc/fstab (on-board mount)
/DEV/MYVG/MYLV/MYLVM ext4 defaults,acl 0 0 (write to config file)
[[Email protected]~]# lvextend-l 18g/dev/myvg/mylv (expands volume group space to 18 g)
................
[[Email protected]~]# resize2fs/dev/myvg/mylv (extended file system)
............
[[Email protected]~]# df-h (view)
...................

When space is low, expand the volume group to re-enlarge the partition
[[Email protected]~]# parted/dev/vdb mkpart LVM ext4 20G 30G (Extend the original 20G to 30G)
..............
[[Email protected]~] #pvcreate/dev/vdb3 (Create physical volume)
..............
[[Email protected]~] #vgextend myvg/dev/vdb3 (change name to MYVG)
..............
[[Email protected]~] #lvextend-L 20g-n mylv MYVG (expands the volume group space to 20G)
..............
[[Email protected]~]# resize2fs/dev/myvg/mylv (extended file system)
..............
Delete
[[Email protected]~] #umount/dev/mvvg/mylv (uninstall first)
[[Email protected]~] #lvremove/dev/myvg/mylv (delete logical volume MYLV)
[[Email protected]~] #vgremove MYVG (delete volume group)
[[Email protected]~] #pvremove/dev/vdb[1-3] (Delete physical volume)

LVM Other Commands
Syntax of the main command
Vgcreate-s PE Size Volume group name physical volume
Lvcreate-l PE number-N Logical Volume name volume group name
Lvextend-l + size/dev/Volume group name/Logical volume name

————————————————————————————————

RAID disk array Management
Consolidate multiple small/low-speed disks into one large disk with hardware/software technology
Not only can store data, but also can provide some protection to the data
Different RAID levels, features vary

Common RAID levels:
RAID 0: Stripe mode, spread the same document across different disks, parallel write to improve efficiency
RAID 1: Mirroring mode, one document copied into multiple copies, written to different disks, multiple copies improve reliability, no increase in efficiency
RAID 5: Cost-effective Mode: 0 and 1 compromise, at least one disk space as redundant

RAID level feature comparison
Compare RAID 0 RAID 1 RAID 5 raid1+0
Number of disks equal to 2 less than or equal to 2 less than or equal to 3 less than or equal to 4
Storage utilization 100% is greater than or equal to 50% n-1/n greater than or equal to 50%
Redundant parity disk No no No 1 no
Fault tolerance no no there are
IO performance higher than high school

How RAID arrays are implemented
Hard raid: Managed array by raid control card
Motherboard "Array Card" disk "operating system" data

Soft raid: The array is managed by the operating system
Motherboard "Disk" operating system RAID software "data

————————————————————————————————————————————————
Service Management
System services: Independent monitoring, fast response, continuous consumption of system resources
System Services Script:/etc/rc.d/init.d/*
Temporary services: Slow response, access is enabled, and more resources are saved
Temporary service profile:/etc/xinetd.d/*

System Service Control
Basic methods
Service Name Control parameters
Or:/etc/init.d/Service Name control parameters
Main control parameters
Start: Startup
STOP: Stop
Status: View the current status of the service
Restart: restart
Reload: Reload Configuration
[[Email protected] Desktop]# service autofs Restart (restart AutoFS this service)
Stop automount: [OK]
Starting automount: [OK]
[[Email protected] Desktop]#/etc/init.d/autofs Restart (or run script file directly)
Stop automount: [OK]
Starting automount: [OK]

XINETD Super Server
Super daemon, Super Server, unified management of multiple TCP/UDP services, control access rights
[Email protected] Desktop]# Rpm-qi xinetd
... ...
Description:
Xinetd lets you bind the specified service to the specified IP number on your host
Each service has its own specified xinetd configuration file,
These files are located in the/etc/xinetd.d directory
[[Email protected] Desktop]# vim/etc/xinetd.d/telnet
Service Telnet
{
Flags = Reuse
Socket_type = Stream
wait = no
user = root
Server =/usr/sbin/in.telnetd
Log_on_failure + = USERID
Disable = no (change here to No)
}

Service Self-starter
Chkconfig command-line tools
Format: chkconfig--list [service name]
chkconfig [--level level list] Service name on
chkconfig [--level level list] Service name off
[Email protected] Desktop]# chkconfig--list autofs
AutoFS 0: Off 1: Off 2: Off 3: Enable 4: Enable 5: Enable 6: Off

Operational level meaning:
0: Turn off the machine
1: Single-user mode
2: Multi-user mode for character interface (network not supported)
3: Full multi-user mode for character interface
4: Not assigned to use
5: Multi-user mode for graphical interface
6: Restart
——————————————————————————————————————

Linux Fundamentals 9

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.