Showing posts with label USB. Show all posts
Showing posts with label USB. Show all posts

Friday, May 23, 2014

How to Obtain USB Removable Disk Drive Letter Automatically with a Batch Script

Purpose of this script is to determine the drive letter of a USB thumb drive.  Depending on the hardware and drive partitions, every computer you plug a thumb drive into is different.  This will give you the drive letter assuming it is the only removable disk.

for /F "tokens=2 delims==" %%i in ('wmic logicaldisk where "drivetype=2" get name /format:value') do (

    set "usb=%%i"
    call :BREAK
)

:BREAK
echo Your USB Drive is %usb%


NOTE:  The "do" must be on the same line.

Source:  Link Link

Wednesday, March 6, 2013

How to make a bootable USB disk in OS X from an ISO

Use this at your own risk.  I am not responsible if this destroys your USB drive.

Open up a command prompt

Run the following command:

hdiutil convert -format UDRW -o ~/path/to/target.img ~/path/to/something.iso

Change the first path to where you want to save it "somename.img"

The next piece is where the iso is located. Write the path to where its located.

Type "diskutil list" in the command prompt to get a list of devices.

My USB drive was /dev/disk2.  Yours may be different.

Next you need to unmount the drive.  Type "diskutil unmountDisk /dev/disk2"
*Obviously change that command to what your USB disk is*

Next from the command line run sudo dd if=/yournewimage.img.dmg of=/dev/rdiskN bs=1m

And change rdiskN to what you found from the diskutil.  Mine was rdisk2.

Enter your password and wait.

It looks like nothing is happening but it is.  Just wait longer.  Trust me it will finish.

When it finishes, type diskutil eject /dev/diskN

Again change "N" to the number you used previously.

Reboot and boot from it.


Source: Link


Friday, March 30, 2012

How to Install OS X Lion/Mountain Lion from a USB Drive

First you have to purchase it from the App Store.

Locate the the Lion app in the Application Folder (Did notice that I already had it downloaded previously and moved it to my desktop. It actually updated the Lion App on the my desktop and did not show up in my Applications Folder, just an FYI)

Right click and click "Show Package Contents" Go to Contents -> SharedSupport

You'll find a file named "InstallESD.dmg"

Open Disk Utility

Plug in the Thumb Drive. Once it shows up on the left hand side click the Top Level for that thumb drive. You'll know your on the right level if you see the Partition tab on the right hand side.

Click Partitions and select 1 Partition.

Select Mac OS Extended (Journaled) as the Format

You can name it whatever you want.
Click Options -> Select GUID Partition Table

Hit Apply (This will erase anything on the drive)

Click the restore tab

Click the Image button and select the "InstallESD.dmg"

Drag the thumb drive partition on the left to the Destination box. This is the 2nd level down.

Click restore

Once completed, reboot and hold the option key.

Select the thumb drive called Mac OS X

You can let go once you see the Apple Logo

Source: Link OS X 10.7 Lion

How to do it for OS X 10.8 Mountain Lion Link

ShareThis