Skip to content
This repository has been archived by the owner on Mar 2, 2022. It is now read-only.

Fresh SD Cards Not Read #9

Open
mistrgrieve opened this issue Sep 11, 2019 · 4 comments
Open

Fresh SD Cards Not Read #9

mistrgrieve opened this issue Sep 11, 2019 · 4 comments

Comments

@mistrgrieve
Copy link

When using a fresh SD card, the software does not acknowledge them unless you first format them. Is there a way to set the software to image brand new SD cards? I started writing a python script to do this, but I'm having trouble.

@aaronnguyen
Copy link
Owner

Could try to list all the devices in "/dev" then capture only /dev/sd* listings. (/dev/sda, /dev/sdb, /dev/sdc). But then after that validate that they are sd cards somehow.

Never ran into that issue before. let me see if I can replicate it.
And I'll test a few things out. Let me know if you come up with a solution and if we can add it.

@mistrgrieve
Copy link
Author

mistrgrieve commented Sep 17, 2019 via email

@aaronnguyen
Copy link
Owner

listing all devices in /dev then looking for devices didn't seem very effective.
'sudo fdisk -l' did work for me though (l being lowercase L).
The backend should have started with the su crontab, so there shouldn't be any issues with root access. (hopefully)

on the snap side note, you can fork the code and port to whatever you want. I don't mind at all!
I have not heard of snap, just did a quick search, looks like scratch? Would love to see how that project turns out!

@aaronnguyen
Copy link
Owner

Note: found a solution in this question https://codereview.stackexchange.com/questions/152486/parsing-the-lsblk-output

using lsblk might be better, no root access needed. and can display just the disk names and size with the command "lsblk -d -o name,size -n". Will list the mmcblk0 (rpi disk) so will just have it ignore it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants