Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Paste
P25307
swift size calculation
Archived
Public
Actions
Authored by
MatthewVernon
on Apr 19 2022, 10:25 AM.
Edit Paste
Activate Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Flag For Later
Tags
None
Referenced Files
F35058006: swift size calculation
Apr 19 2022, 10:25 AM
2022-04-19 10:25:57 (UTC+0)
Subscribers
None
root
@thanos
-
be1002
:
/
etc
/
swift
# python3
Python
3.7
.
3
(
default
,
Jan
22
2021
,
20
:
04
:
44
)
[
GCC
8.3
.
0
]
on
linux
Type
"help"
,
"copyright"
,
"credits"
or
"license"
for
more
information
.
>>>
import
os
>>>
st
=
os
.
statvfs
(
"/dev/sdb3"
)
>>>
free_bytes
=
st
.
f_frsize
*
st
.
f_bavail
>>>
size_bytes
=
st
.
f_frsize
*
st
.
f_blocks
>>>
free_percent
=
float
(
free_bytes
)
/
float
(
size_bytes
)
*
100
>>>
free_bytes
67380469760
>>>
size_bytes
67380469760
>>>
free_percent
100.0
root
@thanos
-
be1002
:
/
etc
/
swift
# df -l /dev/sdb3
Filesystem
1
K
-
blocks
Used
Available
Use
%
Mounted
on
/
dev
/
sdb3
97608128
48573124
49035004
50
%
/
srv
/
swift
-
storage
/
sdb3
Event Timeline
MatthewVernon
created this paste.
Apr 19 2022, 10:25 AM
2022-04-19 10:25:57 (UTC+0)
MatthewVernon
archived this paste.
Log In to Comment