Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
etersoft-admin-essentials
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
etersoft-admin-essentials
Commits
0d6addb8
Commit
0d6addb8
authored
Apr 01, 2019
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add lvm_cache.sh
parent
f6674c0e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
0 deletions
+43
-0
lvm_cache.sh
hdd/lvm_cache.sh
+43
-0
No files found.
hdd/lvm_cache.sh
0 → 100755
View file @
0d6addb8
#!/bin/sh -x
# writethrough - любые данные будут записаны на кеш и диск, при потере кеша данные не теряются
# writeback - данные пишутся сначала на кеш, после сбрасываются на диск, есть риск потерять данные
VOL
=
HYBRID
SSDDEV
=
/dev/disk/by-id/ata-KINGSTON_SH103S3120G_50026B72440801CE
CSSDDEV
=
$(
realpath
$SSDDEV
)
lv_check
()
{
local
LV
=
"
$1
"
lvs |
grep
-q
"
${
LV
}
_cache"
}
lv_create
()
{
local
LV
=
"
$1
"
local
SIZE
=
"
$2
"
local
CM
=
"
$3
"
[
-n
"
$CM
"
]
||
CM
=
"writethrough"
lvcreate
-L
32M
-n
${
LV
}
_cache_meta
$VOL
$SSDDEV
lvcreate
-L
$SIZE
-n
${
LV
}
_cache
$VOL
$SSDDEV
lvconvert
--type
cache-pool
--cachemode
$CM
--poolmetadata
$VOL
/
${
LV
}
_cache_meta
$VOL
/
${
LV
}
_cache
lvconvert
--type
cache
--cachepool
$VOL
/
${
LV
}
_cache
$VOL
/
$LV
}
lv_disable
()
{
local
LV
=
"
$1
"
lvremove
$VOL
/
${
LV
}
_cache
}
#lv_disable ipfs2
#lv_create ipfs2 20G writeback
#exit
pvscan |
grep
"PV
$CSSDDEV
"
||
vgextend
$VOL
$SSDDEV
lv_check ipfs2
||
lv_create ipfs2 20G
lv_check vz
||
lv_create vz 20G
lv_check stog
||
lv_create stog 20G
lv_check mysql
||
lv_create mysql 3G
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment