abock / image-usb-stick Goto Github PK
View Code? Open in Web Editor NEWCross Platform USB key imaging tool
Home Page: http://abock.org
License: MIT License
Cross Platform USB key imaging tool
Home Page: http://abock.org
License: MIT License
image-usb-stick is a command line tool that safely images USB devices It supports OS X and Linux currently. Without options, the tool runs in an interactive mode. The tool will also only allow imaging of actual external USB storage devices, preventing accidental data loss on internal devices, a problem often encountered when using lower level tools like dd. The tool will also offer to unmount any mounted partitions on the target device. During the imaging process, useful feedback is presented to the user: - Percentage complete - Elapsed time - A visual progress bar - Estimated time remaining
I'm unable to install onto an SD Card:
$ ./image-usb-stick ../GNOME_3.x86_64-0.0.3-Build1.1.iso
Loading disks...
No devices found.
The problem is that the OsxDisk.is_valid() check is too stringent and rejects the SD Card.
Disk Utility information for the SD Card:
$ diskutil info /dev/disk3
Device Identifier: disk3
Device Node: /dev/disk3
Part Of Whole: disk3
Device / Media Name: APPLE SD Card Reader Media
Volume Name:
Escaped with Unicode:
Mounted: No
File System: None
Partition Type: None
Bootable: Not bootable
Media Type: Generic
Protocol: USB
SMART Status: Not Supported
Total Size: 4.1 GB (4075290624 Bytes) (exactly 7959552 512-Byte-Blocks)
Volume Free Space: Not Applicable
Read-Only Media: No
Read-Only Volume: Not applicable (no filesystem)
Ejectable: Yes
Whole: Yes
Internal: Yes
OS 9 Drivers: No
Low Level Format: Not Supported
Patch to fix:
$ diff -u image-usb-stick.bk image-usb-stick
--- image-usb-stick.bk 2011-02-07 16:49:57.000000000 -0500
+++ image-usb-stick 2011-02-07 16:55:07.000000000 -0500
@@ -150,7 +150,7 @@
self.attrs['read_only_media'] == 'No' and \
self.attrs['ejectable'] == 'Yes' and \
self.attrs['whole'] == 'Yes' and \
- self.attrs['internal'] == 'No'
+ (self.attrs['internal'] == 'No' or self.attrs['device_media_name'] == 'APPLE SD Card Reader Media')
def unmount (self):
import subprocess
What kernel are you using for this image?
^
I'm using your tool to write some SUSE Studio generated .raw files.
The only issue i can see is the the progress/percentage indicator is full after less than 1 minute and i suppose it shows only the time elapsed for formatting the USB stick.
Selected: USB_Flash_Disk (/dev/sdc) - 4 GB
WARNING: imaging /dev/sdc may result in data loss! Continue? [Y/N]: Y
100% 0:00:39 [================================================] ETA 0:00:00
Suggest you tweak the script to use /dev/rdisk# instead of /dev/disk# as rdisk is MUCH faster when using dd. dd a 700mb to /dev/rdisk1 (with bs=1m) image takes about a minute, but with /dev/disk1 it takes a good 15 minutes.
Cheers.
We have a request to package this in Homebrew: Homebrew/legacy-homebrew#14018
Would it be possible to tag a stable version? Doesn't need to be "1.0" or anything, just any version number so we get a "real tarball".
If not, let me know, so I can pass on the request until this software is considered stable. Thanks.
Hi, I found a syntax error in your source code
image-usb-stick|262
col 13 error| Missing parentheses in call to 'print'`
I tried to use the program to write to my USB stick using OSX 10.5, but the program reported No devices Found.
I resolved the issue by changing some of the tests on the diskutil output
read_only_media is called read_only:
Read Only: No
The media size has the unit B instead of Bytes:
Total Size: 1002.2 Mi (1050934784 B) (2052607 512-byte blocks)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.