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
525eb7e9
Commit
525eb7e9
authored
Jan 24, 2019
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add print_disks.sh
parent
63870f26
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
0 deletions
+42
-0
print_disks.sh
hdd/print_disks.sh
+42
-0
No files found.
hdd/print_disks.sh
0 → 100755
View file @
525eb7e9
#!/bin/sh
VERBOSE
=
[
"
$1
"
=
"-v"
]
&&
VERBOSE
=
1
.
$(
dirname
$0
)
/print_disks.physorder.sh
#case "$(hostname -s)" in
# clients)
# PHYSORDER="4Q2H 6866 2690 2486 2471 0052 8696 4552 8520"
# ;;
# *)
# echo "Unknown hostname $(hostname -s)"
# exit 1
#esac
echo
>
$0
.log
for
i
in
/dev/sd?
;
do
[
-n
"
$VERBOSE
"
]
&&
echo
[
-n
"
$VERBOSE
"
]
&&
hdparm
-i
$i
|
grep
-B2
SerialNo |
grep
-v
"^$"
SERNO
=
$(
hdparm
-i
$i
|
grep
SerialNo |
sed
-e
"s/.*SerialNo=//g"
|
tail
-c
5
)
[
-n
"
$VERBOSE
"
]
&&
blkid
${
i
}
1
LABEL
=
$(
blkid
-s
LABEL
${
i
}
1 |
sed
-e
's/.*LABEL="\(.*\)"/\1/'
)
printf
"%s %6s %s
\n
"
"
$i
"
"
$LABEL
"
"
$SERNO
"
|
tee
-a
$0
.log
done
echo
>
$0
.log.found
echo
echo
"In physical order:"
for
i
in
$PHYSORDER
;
do
if
grep
"
$i
$"
$0
.log
;
then
grep
"
$i
$"
$0
.log
>>
$0
.log.found
else
echo
"
$i
is MISSED"
fi
done
echo
echo
"Differences:"
sort
<
$0
.log
>
$0
.log.sort
sort
<
$0
.log.found
>
$0
.log.found.sort
diff
-u
$0
.log.sort
$0
.log.found.sort
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