Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

burn: sdcard: size of SDCard #47

Open
3 of 4 tasks
laszewsk opened this issue Feb 20, 2021 · 5 comments
Open
3 of 4 tasks

burn: sdcard: size of SDCard #47

laszewsk opened this issue Feb 20, 2021 · 5 comments
Labels
2 priority two (high) bug Something isn't working

Comments

@laszewsk
Copy link
Member

laszewsk commented Feb 20, 2021

For SDCard size we need to find out how to get the size in

  • PI (Gregor)
  • Linux (Anthony)
  • Windows (DK)
  • Gregor

gregor can help once you find it out.

we need a function thatreturns the size of an sd card given the device

def size(device=dev/disk2):
return number in bytes

@laszewsk laszewsk added bug Something isn't working High Priority labels Feb 20, 2021
@aporlowski
Copy link
Collaborator

aporlowski commented Feb 20, 2021

cms burn info reports the sd card size on linux

# ----------------------------------------------------------------------
# SD Cards Found
# ----------------------------------------------------------------------+----------+----------------------------------------------+-------------+------------------+--------------+------------+---------+----------+-------------+-------------+
| Path     | Info                                         | Formatted   | Size             | Plugged-in   | Readable   | Empty   | Access   | Removable   | Writeable   |
|----------+----------------------------------------------+-------------+------------------+--------------+------------+---------+----------+-------------+-------------|
| /dev/sdb | Generic- USB3.0 CRW-SD/MS 1.00 PQ: 0 ANSI: 6 | True        | 64.1 GB/59.7 GiB | True         | True       | False   | True     | True        | True        |
+----------+----------------------------------------------+-------------+------------------+--------------+------------+---------+----------+-------------+-------------+

@laszewsk
Copy link
Member Author

do we have a diffenet command that gets only one number?

@laszewsk
Copy link
Member Author

laszewsk commented Feb 20, 2021

so we can use what we have and use or we just use info and parse the first value
split by space and multiply by 1000**3

# ----------------------------------------------------------------------
# Operating System SD Card
# ----------------------------------------------------------------------

Disk /dev/mmcblk0: 59.7 GiB, 64088965120 bytes, 125173760 sectors

@laszewsk laszewsk added the help wanted Extra attention is needed label Feb 20, 2021
@laszewsk laszewsk changed the title size of SDCard on PI size of SDCard Mar 6, 2021
@laszewsk laszewsk changed the title size of SDCard sdcard: size of SDCard Apr 2, 2022
@laszewsk laszewsk changed the title sdcard: size of SDCard burn: sdcard: size of SDCard May 2, 2022
@laszewsk laszewsk added the burn label May 2, 2022
@jpfleischer jpfleischer transferred this issue from cloudmesh/cloudmesh-pi-cluster May 2, 2022
@jpfleischer jpfleischer added 2 priority two (high) and removed High Priority labels May 2, 2022
@jpfleischer
Copy link
Member

WINDOWS

Sledgehammer@Sledgehammer MINGW64 ~
$ cms burn info

# ----------------------------------------------------------------------
# This is a Windows Computer
# ----------------------------------------------------------------------

+----------+-------+-------+---------+-------+-----------+--------+----------+--------+----------+
| Volume   |   ### | Ltr   | Label   | Fs    | Type      | Size   | Status   | Info   | dev      |
|----------+-------+-------+---------+-------+-----------+--------+----------+--------+----------|
| Volume   |     2 | E     | boot    | FAT32 | Removable | 256 MB | Healthy  |        | /dev/sdb |
+----------+-------+-------+---------+-------+-----------+--------+----------+--------+----------+
+--------+-----------------+-----------------+-----------------------------------+---------+--------------+--------+
|   Disk | InterfaceType   | MediaType       | Model                             |   Model | Partitions   | Size   |
|--------+-----------------+-----------------+-----------------------------------+---------+--------------+--------|
|      1 | USB             | Removable Media | Generic STORAGE DEVICE USB Device |       2 | 59 GB        | Online |
+--------+-----------------+-----------------+-----------------------------------+---------+--------------+--------+
WARNING: We could not find your USB reader in the list of known readers
# Timer: 1.9406s Load: 0.0070s burn info
(ENV3)
Sledgehammer@Sledgehammer MINGW64 ~

@laszewsk
Copy link
Member Author

fix field names
looks liek that the split of the info has wrong order. there may need to be other fileds. create as much info as possible, and compare to the result of info posted next from linux

+----------+------------------------+-------------+------------------+--------------+------------+---------+----------+-------------+-------------+
| Path     | Info                   | Formatted   | Size             | Plugged-in   | Readable   | Empty   | Access   | Removable   | Writeable   |
|----------+------------------------+-------------+------------------+--------------+------------+---------+----------+-------------+-------------|
| /dev/sdd | Generic STORAGE DEVICE | True        | 64.1 GB/59.7 GiB | True         | True       | False   | True     | True        | True        |
+----------+------------------------+-------------+------------------+--------------+------------+---------+----------+-------------+-------------+

compare also with macos

@laszewsk laszewsk removed the help wanted Extra attention is needed label May 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 priority two (high) bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants