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
03375523
Commit
03375523
authored
Jan 12, 2019
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
force rewrite when SG_IO: bad sense error
parent
7ca01f96
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletion
+13
-1
fix_disk.sh
hdd/fix_disk.sh
+13
-1
No files found.
hdd/fix_disk.sh
View file @
03375523
...
...
@@ -34,9 +34,21 @@ fix_block()
{
local
DEV
=
$1
local
block
=
$2
local
force
=
"
$FORCE
"
# FIXME: possible badblocks always returns true
# badblocks -b 512 -v -s $DEV $block $block && { echo "Already OK, skipped..." ; [ -z "$FORCE" ] && return ; }
test_block
$DEV
$block
&&
{
echo
"Already OK, skipped..."
;
[
-z
"
$FORCE
"
]
&&
return
;
}
if
test_block
$DEV
$block
>
/tmp/test_block.out 2>&1
;
then
if
grep
"SG_IO: bad/missing sense data"
/tmp/test_block.out
;
then
force
=
1
fi
if
[
-n
"
$force
"
]
;
then
echo
"Force rewrite ..."
else
echo
"Already OK, skipped ..."
return
fi
fi
if
[
-z
"
$TESTONLY
"
]
;
then
echo
"Test only"
return
...
...
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