Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Lvm logical Volume and Network Management

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)06/01 Report--

Lvm logical Volume and Network Management

Logical Volume Manager (LVM)

LVM:

Logical Volume Manager, Version: 2

Dm: device mapper:

A module that organizes one or more underlying block devices into one logical device

Device name:

/ dev/dm-#

Soft links:

/ dev/mapper/VG_NAME-LV_NAME

/ dev/mapper/vol0-root

/ dev/VG_NAME/LV_NAME / dev/vol0/root

1 an abstraction layer that allows easy manipulation of volumes, including resizing the file system

2 allows file systems to be reorganized across multiple physical Devic

3 specify the device as a physical volume

4 create a volume group with one or more physical volumes

5 physical volumes are defined with fixed-size physical areas (Physical Extent, PE)

6 logical volumes created on physical volumes are made up of physical areas (PE)

7 File systems can be created on logical volumes

LVM changes the capacity of a file system

LVM can flexibly change the capacity of LVM to convert data by exchanging PE, transferring the PE in the original LV to other devices to reduce the capacity of LV, or adding PE from other devices to LV to increase the capacity.

View the usage of LVM

Increase or decrease logical volumes

Delete logical Volum

To delete a logical volume, you must first delete LV, then delete VG, and finally delete PV.

Click Volume Group in logical Volume Manager-> LV logical Volume in logical View

Click "remove selected logical volumes", delete VG, and finally delete PV.

Pv management tools

Display pv information

Pvs: brief pv information display

Pvdisplay

Create pv

Pvcreate / dev/DEVICE

Vg management tools

Show Volume Group

Vgs vgdisplay

Create a volume group

Vgcreate [- s # [kKmMgGtTpPeE]] VolumeGroupName PhysicalDevicePath [PhysicalDevicePath...]

Manage volume groups

Vgextend VolumeGroupName PhysicalDevicePath [PhysicalDevicePath...]

Vgreduce VolumeGroupName PhysicalDevicePath [PhysicalDevicePath...]

Delete volume group

Do pvmove first.

Then do vgremove.

Lv management tools

Show logical volumes

Lvs

Lvdisplay

Create a logical volume

Lvcreate-L # [mMgGtT]-n NAME VolumeGroup

Delete logical Volum

Lvremove / dev/VG_NAME/LV_NAME

Resize the file system

Fsadm [options] resize device [new_ size[BKMGTEP]]

Resize2fs [- f] [- F] [- M] [- P] [- p] device [new_size]

Expand and shrink logical volumes

Extend logical volumes:

Lvextend-L [+] # [mMgGtT] / dev/VG_NAME/LV_NAME

Resize2fs / dev/VG_NAME/LV_NAME

Reduce logical volumes:

Umount / dev/VG_NAME/LV_NAME

E2fsck-f / dev/VG_NAME/LV_NAME

Resize2fs / dev/VG_NAME/LV_NAME

Lvreduce-L [-]

/ dev/VG_NAME/LV_NAME # mount

Create a logical volume instance

Create a physical volume

Pvcreate / dev/sda3

Assign physical volumes to a volume group

Vgcreate vg0 / dev/sda3

Create a logical volume from a volume group

Lvcreate-L 256m-n data vg0

Mke2fs-j / dev/vg0/data

Mount / dev/vg0/data / mnt/data

Logical Volume Manager snapshot

A snapshot is a special logical volume that is an exact copy of the logical volume that exists when the snapshot is generated. For temporary copies of existing datasets and other operations that need to be backed up or replicated, snapshots are the most appropriate choice.

1 Snapshots consume space only if they are different from the original logical volume.

2 A certain amount of space will be allocated to it when the snapshot is generated, but it will be used only if the original logical volume or snapshot has changed.

3 when there is a change in the original logical volume, the old data is copied to the snapshot.

4 the snapshot contains only the data changed in the original logical volume or since the snapshot was generated

5 the volume size for snapshots requires only 15% or 20% of the original logical volume. You can also use lvextend to enlarge the snapshot.

Use LVM Snapshot

Create a snapshot of an existing logical volume

Create a snapshot

Lvcreate-l 64-s-n snap-data-p r / dev/vg0/data

Mount a snapshot

Mkdir-p / mnt/snap

Mount-o ro / dev/vg0/snap-data / mnt/snap

Delete snapshot

Umount / mnt/databackup

Lvremove / dev/vg0/databackup

Btrfs file system

Btrfs (B-tree, Butter FS, Better FS), GPL, Oracle, 2007, CoW

Core features:

Multi-physical volume support: btrfs can be composed of multiple underlying physical volumes; support RAID, as well as online "add", "remove", "modify"

Copy update mechanism on write (CoW): copy, update, and replace pointers instead of "in-place" updates

Data and metadata check code: checksum

Subvolume: sub_volume

Snapshots: snapshots that support snapshots

Transparent compression

File system creation:

Mkfs.btrfs

-L 'LABEL'

-d: raid0, raid1, raid5, raid6, raid10, single

-m: raid0, raid1, raid5, raid6, raid10, single, dup

-O

-O list-all: lists all supported feature

Mkfs.btrfs-L mydata-f / dev/sdb / dev/sdc

Property View:

Btrfs filesystem show; blkid

Btrfs filesystem show-mounted | all-devices

Mount the file system:

Mount-t btrfs / dev/sdb MOUNT_POINT

Transparent compression mechanism:

Mount-o compress= {lzo | zlib} DEVICE MOUNT_POINT

Modify file system size online

Man btrfs

Btrfs filesystem resize-10G / mydata

Btrfs filesystem resize + 5G / mydata

Btrfs filesystem resize max / mydata

View

Df-lh; btrfs filesytem df / mydata

Add a device:

Man btrfs-device

Btrfs device add / dev/sdd / mydata

Subvolume management

Btrfs subvolume show / mnt/subv1

Btrfs subvolume delete / mydata/subv1

Create a snapshot:

Btrfs subvolume snapshot / mydata/subv1\

/ mydata/snapshot_subv1 btrfs subvolume list / mydata

Delete snapshot

Btrfs subvolume delete / mydata/snapshot_subv1

Take a snapshot of a file (current volume)

Cd / mydata/subv1

Cp-reflink testfile snapshot_testfil

Experimental ext4 and btrfs transform each other

Btrfs converts ext4 file system

Umount / mnt

Btrfs-convert-r / dev/sdd1

Blkid / dev/sdd1

And then converted to btrfs.

Btrfs-convert / dev/sdd1

Network management

Network concept

Network refers to computers and peripherals with different geographical locations and independent functions, through the communication lines connected in the network operating system, managing and coordinating network management software and network communication protocols, realize the resource sharing and information transmission of the computer system.

Functions and advantages of resource sharing

Data and applications

Resources

Network storage

Backup equipment

Common network physical components

Router

Exchanger

Network card

Connector

The impact of user applications on the network

Batch application

FTP, TFTP, inventory updates

No need for direct human interaction

Bandwidth is important, but not a critical factor

Interactive application

Inventory query, database update.

Human-computer interaction.

Because users need to wait for a response, response time is important, but not a critical factor, unless you have to wait a long time.

Real-time application

VoIP

Video

Human interaction

End-to-end delay is critical

Characteristics of the network

Speed

Cost

Security.

Usability

Expandability

Reliability.

Topological structure

Physical topology classification

Bus topology

Ring topology

Star topology

Bus topology

All devices can receive signals

Star topology

Transmit through the central point

Single point of failure

Extended star topology

More resilient than a star topology.

Ring topology

Signal transmission around the ring

Single point of failure

Double ring topology

The signal is transmitted in the opposite direction

More resilient than a single ring.

Full mesh topology

Strong fault tolerance

High cost of implementation

Partial mesh topology

Find a balance between fault tolerance and cost

Seven-layer structure of OSI Model

Application layer: provide authentication login for processes to provide network services

Presentation layer: provides encrypted build data negotiation transfer syntax

Session layer: communication between hosts establishes management and terminates sessions between applications

Transport layer: ensure the reliability of data with detection and recovery of data

Network layer: data transmission chooses the best path to support logical addressing

Data link layer: defines how to format data, how to control access and support error detection

Physical layer: binary transport

Data encapsulation

Data unencapsulation

Peer to peer communication

Three communication modes

Unicast

Multicasting

Broadcast

The composition of LAN

Pc router switch hub

Make crystal head

Sequence

White orange, white green, blue, white, green, white, brown

UTP straight-through Straight-Through

UTP Cross Line Crossover

Carrier sense multiple access CSMA/CD for collision detection

Hub hub

Hub: multi-port repeater

Hub does not remember which MAC address the packet was sent from and which MAC address is on which port of Hub

Features of Hub: shared bandwidth half-duplex

Ethernet bridge

Advantages of switched Ethernet

Expanded network bandwidth

The network conflict domain is divided so that the network conflict is limited to a minimum.

As a more intelligent switching device, the switch can provide the functions required by more users: priority, virtual network, remote detection.

How Ethernet Bridge works

1 Ethernet bridge listens to the source MAC address in the data frame, learns MAC, and establishes the MAC table

2 for unknown MAC addresses, the bridge will forward to all ports except the port on which the frame was received

3 when the bridge receives a data frame, if the destination of the frame is on the network segment where the receiving port is located, it filters out the data frame; if the destination MAC address is on another port, the bridge forwards the frame to that port

4 when the bridge receives a broadcast frame, it is immediately forwarded to all ports except the receiving port

Comparison between Hub and switch

1 the hub belongs to the first physical layer device of OSI, while the bridge belongs to the second layer data link layer device of OSI

2 from the point of view of the mode of operation, the hub is a broadcast mode, and all ports are in a collision domain. The bridge can isolate conflicts through the port

3 Hub is all shared bus and shared bandwidth. Each port of the bridge occupies one bandwidth.

Router

In order to achieve routing, the router needs to do the following:

Separate broadcast domain

Choose the best path to the destination in the routing table

Maintain and check routing information

Connect the wide area network

Routing:

Send a packet from one device to another in a different network. This work is done by the router. The router is only concerned with the state of the network and determining the best path in the network. The implementation of routing depends on the routing table in the router.

VLAN

Separate broadcast domain

Safety

Flexible management

VLAN = broadcast domain = logical network (Subnet)

TCP/IP protocol stack

Transmission Control Protocol

/ Internet Protocol

Transmission control protocol / Internet interconnection protocol

TCP/IP is a Protocol Stack.

Including TCP, IP, UDP, ICMP, RIP, TELNET, FTP, SMTP, ARP and many other protocols

It originated from the ARPA project, the predecessor of the Internet of the U.S. Department of Defense (DoD). On January 1, 1983, TCP/IP replaced the old network control protocol NCP and became the cornerstone and standard of today's Internet and local area network. It is maintained by the Internet Engineering Task Force. A total of four layers are defined

It corresponds to the layering of the ISO reference model.

TCP characteristics

Work at the transport level to the connection protocol

Duplex mode operation

Error check

Packet sequence

Confirmation mechanism

Data recovery characteristics

TCP header

Establish a link

Three-way handshake

TCP confirmation

Fixed window

TCP sliding window

UDP characteristics

Working at the transport layer

Provide unreliable network access

Non-connection oriented protocol

Limited error checking

High transmission performance

Myriad data recovery features

UDP header

Internet layer

Internet Control Message Protocol

Address Resolution Protocol

ARP broadcast transmission

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 236

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Network Security

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report