Skip to main content

No project description provided

Project description







<b>BRUNCH</b>
<b># DRIVE OPERATIONS</b>

<b>CAUTION</b>
<b>THIS MODULE IS USED FOR ERASING PERSISTANT STORAGE DEVICES LIKE:</b>
<b>SOLID STATE DRIVES, HARD DRIVES, SD CARDS, MICRO SD CARDS, FLASH DRIVES</b>

<b>SCAN</b>
NEEDS ACCESS TO BLOCK SPECIAL FILE PATH WHERE DRIVE IS ATTACHED.
EXAMPLE: /dev/sd----

CONCEPTS:
MEAL: THIS IS THE ENTIRE SPAN OF INDEXES TO BE READ
PLATE: THIS IS THE ONE SPAN OF INDEXES WITHIN THE MEAL

"DRIVE INFORMATION" SECTION BELOW HAS INFO PERTAINING TO FINDING
THE BYTES COUNT OF A DRIVE.

<code>
import BRUNCH.SCAN as SCAN

#
# CAUTION:
#
# EXAMPLE: /dev/sd----
#
DRIVE_PATH = ""

BYTE_STRING = b''
def PROGRESS (PARAMS):
nonlocal BYTE_STRING;
BYTE_STRING += PARAMS ['PLATE']

SCAN.START ({
"DRIVE PATH": DRIVE_PATH,

"BYTES INDEXES": [ 0, 28 ],
"BYTES PER PLATE": 10,

"PROGRESS": PROGRESS
})

print (BYTE_STRING)
#
# b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
#
</code>

<b>DRIVE INFORMATION</b>
#
# lsblk -b -p
# lsblk -b -p --json
# lsblk -S
#
[TCSH] lsblk -b -p

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
/dev/sda 8:0 0 40018599936 0 disk
├─/dev/sda1 8:1 0 629145600 0 part /boot/efi
├─/dev/sda2 8:2 0 1073741824 0 part /boot
└─/dev/sda3 8:3 0 38313918464 0 part /home
/
/dev/sdb 8:16 0 40018597888 0 disk
/dev/zram0 252:0 0 8589934592 0 disk [SWAP]

#
# https://en.wikipedia.org/wiki/Util-linux
# https://github.com/util-linux/util-linux
#
[TCSH] fdisk -l

Disk /dev/sdc: 37.27 GiB, 40018597888 bytes, 78161324 sectors
Disk model: high speed
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

THEREFORE:
40,018,597,888

DRIVE PATH: /dev/sdb
BYTE INDEXES: [ 0, 40018597887 ]

40018597888 / 78161324 = 512

#
# /dev/sda is the operating system drive
#

<b>PERTINENT</b>
cat /proc/partitions

import
os.statvfs ("/dev/sdb")

os.statvfs_result (
f_bsize=4096,
f_frsize=4096,
f_blocks=1024,
f_bfree=1024,
f_bavail=1024,
f_files=8213539,
f_ffree=8212926,
f_favail=8212926,
f_flag=2,
f_namemax=255
)




Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

BRUNCH-0.0.4.tar.gz (126.5 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page