Linux: Difference between revisions
put list of commands in a table |
|||
Line 20: | Line 20: | ||
=== Physical volume === | === Physical volume === | ||
Initialize for use as LVM physical volume. | {| class="wikitable" border="1" style="border-collapse:collapse" | ||
! style="text-align: center;"| Description | |||
< | ! Command | ||
|- | |||
</ | | Initialize for use as LVM physical volume. | ||
| <code>pvcreate /dev/sdb1</code> | |||
Scanning for block devices. | |- | ||
| Scanning for block devices. | |||
< | | <code>lvmdiskscan</code> | ||
|- | |||
</ | | Display the physical volumes. | ||
| <code>pvdisplay</code> | |||
Display the physical volumes. | |- | ||
| Show all physical devices. | |||
< | | <code>pvscan</code> | ||
|- | |||
</ | | Prevent allocation of physical extents on the free space of one or more physical volumes. | ||
| <code>pvchange -x n /dev/sdb1</code> | |||
Show all physical devices. | |- | ||
| Resize. | |||
< | | <code>pvresize</code> | ||
|- | |||
</ | | Remove LVM label. | ||
| <code>pvremove</code> | |||
Prevent allocation of physical extents on the free space of one or more physical volumes. | |} | ||
< | |||
</ | |||
Resize. | |||
< | |||
</ | |||
Remove LVM label. | |||
< | |||
</ | |||
=== Volume group === | === Volume group === | ||
Create a volume group. | {| class="wikitable" border="1" style="border-collapse:collapse" | ||
! style="text-align: center;"| Description | |||
< | ! Command | ||
|- | |||
</ | | Create a volume group. | ||
| <code>vgcreate vg1 /dev/sdb1 /dev/sdc1</code> | |||
Add a physical volume to a volume group. | |- | ||
| Add a physical volume to a volume group. | |||
< | | <code>vgextend vg1 /dev/sdd1</code> | ||
|- | |||
</ | | Display volume group. | ||
| <code>vgdisplay new_vg</code> | |||
Display volume group. | |- | ||
| Scan disks for volume groups. | |||
< | | <code>vgscan</code> | ||
|- | |||
</ | | Remove a physical volume from a volume group. | ||
| <code>vgreduce group_name /dev/sdc1</code> | |||
Scan disks for volume groups. | |- | ||
| Change the maximum number of logical volumes of volume group vg00 to 128. | |||
< | | <code>vgchange -l 128 /dev/vg00</code> | ||
|- | |||
</ | | Activate or deactivate a volume group. | ||
| <code>vgchange -a n my_volume_group</code> | |||
Remove a physical volume from a volume group. | |- | ||
| Remove a volume group. | |||
< | | <code>vgremove officevg</code> | ||
|- | |||
</ | | Split the physical volumes of a volume group and create a new volume group. | ||
| <code>$ vgsplit bigvg smallvg /dev/ram15<br>Volume group "smallvg" successfully split from "bigvg"</code> | |||
|- | |||
| Merge the inactive volume group my_vg into the active or inactive volume group databases giving verbose runtime information. | |||
< | | <code>vgmerge -v databases my_vg</code> | ||
|- | |||
</ | | Change the name of a volume group. | ||
| <code>vgrename vg02 my_volume_group</code> | |||
Activate or deactivate a volume group. | |} | ||
< | |||
</ | |||
Remove a volume group. | |||
< | |||
</ | |||
Split the physical volumes of a volume group and create a new volume group. | |||
< | |||
$ vgsplit bigvg smallvg /dev/ram15 | |||
Volume group "smallvg" successfully split from "bigvg" | |||
</ | |||
Merge the inactive volume group my_vg into the active or inactive volume group databases giving verbose runtime information. | |||
< | |||
</ | |||
Change the name of a volume group. | |||
< | |||
</ | |||
= File = | = File = |
Revision as of 18:21, 2 April 2018
SSH
Description | Command |
---|---|
Create private/public SSH key file using 2048 bit encryption and with a comment. The command creates files under ~/.ssh folder. | ssh-keygen -b 2048 -C user@host.domain
|
Push public SSH key to a server | ssh-copy-id -p 41111 -i ~/.ssh/id_rsa.pub mhan@remote.server.com
|
Disk
LVM
Physical volume
Description | Command |
---|---|
Initialize for use as LVM physical volume. | pvcreate /dev/sdb1
|
Scanning for block devices. | lvmdiskscan
|
Display the physical volumes. | pvdisplay
|
Show all physical devices. | pvscan
|
Prevent allocation of physical extents on the free space of one or more physical volumes. | pvchange -x n /dev/sdb1
|
Resize. | pvresize
|
Remove LVM label. | pvremove
|
Volume group
Description | Command |
---|---|
Create a volume group. | vgcreate vg1 /dev/sdb1 /dev/sdc1
|
Add a physical volume to a volume group. | vgextend vg1 /dev/sdd1
|
Display volume group. | vgdisplay new_vg
|
Scan disks for volume groups. | vgscan
|
Remove a physical volume from a volume group. | vgreduce group_name /dev/sdc1
|
Change the maximum number of logical volumes of volume group vg00 to 128. | vgchange -l 128 /dev/vg00
|
Activate or deactivate a volume group. | vgchange -a n my_volume_group
|
Remove a volume group. | vgremove officevg
|
Split the physical volumes of a volume group and create a new volume group. | $ vgsplit bigvg smallvg /dev/ram15
|
Merge the inactive volume group my_vg into the active or inactive volume group databases giving verbose runtime information. | vgmerge -v databases my_vg
|
Change the name of a volume group. | vgrename vg02 my_volume_group
|
File
Permissions
Letter | Number |
---|---|
r | 4 |
w | 2 |
x | 1 |
rw- | 6 |
r-x | 5 |
rwx | 7 |