Implementing Linux physical volume management with interactive shell scripts

Source: Internet
Author: User

# scripts are only for Exchange learning and use!

# The current version of the script is 1.0. Implements the creation of physical volumes, removing, changing (enabling/disabling assignments), scanning, viewing features.

# The following will complement the management of volume groups and logical volumes and be integrated into a Linux LVM TOOL. Like the Smit of Aix. Although, it can only manage LVM.

# The script has been tested on red Hat Enterprise Linux 5.4 64bit. Applies in principle to Rhel 5 and Rhel 6.

# Welcome suggestions for improvement.

# Direct copy pay attention to punctuation. You can also download files through a micro-disk to avoid the problems caused by replication: Http://vdisk.weibo.com/s/zKW6M

#!/bin/bash

# Version 1.0

# author:xin23 http://weibo.com/231988

PV ()

{

Nextline ()

{

echo ""

}

Split ()

{

Echo '-----------------------------------------------------------------------'

}

Echotitle ()

{

echo "--------$Title-----------------------------------------"

}

Showpvfirstmenu ()

{

Echo '

Physical Volumn Main Menu

Input number to choose!

Create Physical Volumn ... 1

Remove Physical Volumn ... 2

Change Physical volumn ... 3

Show Physical volumn ... 4

Scan Physical Volumn ... 5

Exit ... 6 '

Nextline

}

Getchoice ()

{

Read-p ' Input Your Choice: ' Var

Nextline

}

Confirmoperate ()

{

Nextline

echo "Continue ... y

Return ... n "

Nextline

Getchoice

Nextline

Run

}

Related Article

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.