Command Guide-2
Command Guide-2
[[email protected]]# df –h
[[email protected]]# du –sh
Label
[[email protected]]# mount –l
Swap Partition
Turn on Swap
[[email protected]]# vl /etc/fstab
LVM is a method of allocating hard drive space into logical volumes that can be easily
resized.
With LVM, the hard drive or set of hard drives is allocated to one or more physical
volumes.
The physical volumes are then combined into volumes groups.
Each volumes group is divided into logical volumes, which are formatted with a file
system like ext3 and are then mounted.
Creating Partitions
Physical Volume
Volume Group
Logical volume
#parted /dev/sdb
or
#parted
(parted)select /dev/sdb
(parted)unit GB or TB
(parted)print
(parted)quit
#mkfs.ext4 /dev/sdb1
#mkdir /mydisk
#mount /dev/sdb1 /mydisk
-----------------------------------------------------------------------------------------
Create GPT Disk Linux Partition
#fdisk -l /dev/sdb
#parted /dev/sdb
or
#parted
(parted)select /dev/sdb
(parted)mklabel gpt
(parted)unit TB
(parted)mkpart primary 0.00TB 3.00TB
(parted)print
(parted)quit
#mkfs.ext4 /dev/sdb1
#mkdir /mydisk
#mount /dev/sdb1 /mydisk
------------------------------------------------------------------------------------------
Create LVM Partition
#fdisk /dev/sdb
>n
type: p
start: Enter
end: Enter
>p
>t
type:8e
>p
>w
#fdisk /dev/sdc
>n
type: p
start: Enter
end: Enter
>p
>t
type:8e
>p
>w
#lvmdiskscan
#lvextend -L100G /dev/VolGroup00/HDD01 ==> Resize to 100GB Logical Volume
#lvextend -L+100G /dev/VolGroup00/HDD01 ==> Increase to 200GB Logical Volume
#pvcreate /dev/sdd1
#vgextend VolGroup00 /dev/sdd1
-------------------------------------------------------------------------------------------------------------------
#os=RedHat
#ver=7
#echo –e “$os\t$ver”
#echo –e “$os\n$ver”
#read os
Redhat
#read ver
7
#hello()
>{
>echo “Hello World”
>echo “Today is `date`”
>}
hello()
{
echo “Hello World”
echo “Today is `date”
}
if [ condition ]; then
command
command
fi
if [ condition ]; then
command
command
else
command
command
fi