Write an ISO image to USB Hard Disk

General discussion relating to the O2 Joggler, from the default O2 setup, to alternative operating systems and applications.
Post Reply
markmiles
Posts: 4
Joined: Tue Nov 22, 2011 6:54 pm

Write an ISO image to USB Hard Disk

Post by markmiles »

First post after reading almost every day the forum to see what's new on this amazing community.

I've been playing with many distros just to see wich one is the best for me and after installing Squeezebox server and the player under Ubuntu i can confirm there is a winner ;)

But what I need right know is boot the Ubuntu Image from an external Hard Disk but after trying almost everything I didn't succeed.

I just need to know what you guys did to make the hard disk bootable.

Thanks in advance ;-)
Excuse me if I just say something senseless since I'm spanish :D
gegs
Posts: 1146
Joined: Fri Mar 04, 2011 3:22 pm
Location: Edinburgh

Re: Write an ISO image to USB Hard Disk

Post by gegs »

It's quite easy to do, you just need to make sure that Windows assigns the same drive letter to the hard drive as it does to a USB stick when they are inserted separately. For example if you plug in a USB stick and it is given a drive letter E: and you remove it (safely) and plug in the hard drive and it is assigned the letter E: then you're good to go. If the devices are assigned different letters, you can force Windows to assign the drive letter you want to the hard drive.

Use Windiskimager as if you were writing to the stick (i.e. with the stick inserted), then before writing the image remove the stick by pulling it out (don't go through the "safely remove" procedure) plug in your hard drive, hit the "write" button and it will work without a hitch, at least in my experience.

I use an ext4 image for a hard disk and use Gparted to increase the size of the linux partitions. I then format the remaining space for media etc. I usually have the linux install around 20-30GB and the rest formatted as FAT32, which is compatible with more devices. This allows me to, for example, download media files to the FAT32 partition, set it up as a samba share and use the Joggler as a NAS to stream to Xbox360, Wii and Apple TV2. I can also unplug the drive and access the media files using non-Linux devices.
FyodorNinian
Posts: 55
Joined: Tue Aug 30, 2011 11:40 am

Re: Write an ISO image to USB Hard Disk

Post by FyodorNinian »

gegs wrote:It's quite easy to do, you just need to make sure that Windows assigns the same drive letter to the hard drive as it does to a USB stick when they are inserted separately. For example if you plug in a USB stick and it is given a drive letter E: and you remove it (safely) and plug in the hard drive and it is assigned the letter E: then you're good to go. If the devices are assigned different letters, you can force Windows to assign the drive letter you want to the hard drive.

Use Windiskimager as if you were writing to the stick (i.e. with the stick inserted), then before writing the image remove the stick by pulling it out (don't go through the "safely remove" procedure) plug in your hard drive, hit the "write" button and it will work without a hitch, at least in my experience.

I use an ext4 image for a hard disk and use Gparted to increase the size of the linux partitions. I then format the remaining space for media etc. I usually have the linux install around 20-30GB and the rest formatted as FAT32, which is compatible with more devices. This allows me to, for example, download media files to the FAT32 partition, set it up as a samba share and use the Joggler as a NAS to stream to Xbox360, Wii and Apple TV2. I can also unplug the drive and access the media files using non-Linux devices.
Hi there

Thanks for posting the above. I've also been trying to place an OS on an external HDD. I managed to get one of the xp images onto a HDD and managed to get it up and running on the joggler, however I can't get xubuntu to work. I use windiskimager with the usb flash / HDD swap method you outlined above. If I try to write the btrfs, the write fails at 80%. If I try to write the ext4 version, it writes successfully but when I try to boot into it on the joggler i get this message: 'error: no such partition. error: you need to load the kernal first. Failed to boot both default and fallback entries.' I haven't touched partitions since writing the img to the HDD - I have no experience of using gparted so am not too sure what to do with partitions. Any advice appreciated! :-)
gegs
Posts: 1146
Joined: Fri Mar 04, 2011 3:22 pm
Location: Edinburgh

Re: Write an ISO image to USB Hard Disk

Post by gegs »

I think you need to reformat your hard disk before trying again. If you've used it before it's probably already got a FAT16 boot sector that's been corrupted. Best to delete all the partitions and start again.

The best way to delete the partitions in Windows (I'm on XP) is to go to Control Panel > Administrative Tools > Computer Management > Disk Management and (sorry for the next All Caps bit) MAKE SURE YOU SELECT THE CORRECT DEVICE IN THE BOTTOM RIGHT PANE! Right click on each partition on the portable drive and delete each one. Now right click and create a new partition taking up the whole disk. You have the opportunity to assign a drive letter here, so make sure you choose the one that will make Windiskimager work with your USB stick.

Google "Gparted" and read up on how to use it. As with Disk Management in Windows (no caps this time) make sure you choose the correct device you want to modify. All the devices won't be visible in the dialogue - you need to choose the correct one from a drop-down menu. Gparted can be run from a Joggler linux distro but it isn't installed by default; however, I use Gparted from a bootable live CD on my PC. You can also use Gparted to delete and create partitions, like in Windows Disk Management (but with more options).

There is a Gparted tutorial here: http://bit.ly/4qvbIU
Gparted live is downloadable from here: http://bit.ly/3hhg
Wikipedia Gparted page (a bit sparse but shows what actions are supported for each filesystem): http://bit.ly/fkQOFt

I would use ext4 for any conventional hard disk based system. BuZz's btrfs images are optimized for solid state devices like USB sticks or SSD drives.
markmiles
Posts: 4
Joined: Tue Nov 22, 2011 6:54 pm

Re: Write an ISO image to USB Hard Disk

Post by markmiles »

OK, it's done! thanks for your help gegs, next is try to figure out how to permanently mount a samba share to access all my music from the joggler, I'm playing with fstab but no luck, i just keep writing parameters but nothing by now.
Excuse me if I just say something senseless since I'm spanish :D
User avatar
BuZz
Site Admin
Posts: 1460
Joined: Fri Mar 04, 2011 1:15 am

Re: Write an ISO image to USB Hard Disk

Post by BuZz »

make sure you have package smbfs installed.

then in fstab something like

Code: Select all

//machine/share     /mountpath            cifs    username=something,password=secret 0 0
You could use something like autofs5 and have it mount on demand also.
gegs
Posts: 1146
Joined: Fri Mar 04, 2011 3:22 pm
Location: Edinburgh

Re: Write an ISO image to USB Hard Disk

Post by gegs »

I just installed samba from Synaptic and used the GUI app to create my samba share. It appears on the Administration menu, I think. Very, very easy - I never had to manually edit fstab.
User avatar
BuZz
Site Admin
Posts: 1460
Joined: Fri Mar 04, 2011 1:15 am

Re: Write an ISO image to USB Hard Disk

Post by BuZz »

samba is the server for sharing your joggler drive. smbfs/cifs is a filesystem client, for mounting shares from other machines locally.
gegs
Posts: 1146
Joined: Fri Mar 04, 2011 3:22 pm
Location: Edinburgh

Re: Write an ISO image to USB Hard Disk

Post by gegs »

Ah-ha! It's always been one way traffic for me - Joggler to Apple TV. I've not tried mounting shares from other devices and I misunderstood markmiles' intention. But my interest has been piqued....
markmiles
Posts: 4
Joined: Tue Nov 22, 2011 6:54 pm

Re: Write an ISO image to USB Hard Disk

Post by markmiles »

Ok, now I'm finally done, it was a matter of user/password, just needed to write them properly since I was using a guest account and never used them, but creating an user account did the trick.

BTW, just if someone is interested my Joggler mounts a samba share on a USB hard disk attached to an Aiport Extreme witch is not a regular Nas capable device but do its job like a charm on this.

Finally have to attach an external DAC, I will search into the forum since I've seen particular threads about USB audio output.

Thanks both for your help.
Excuse me if I just say something senseless since I'm spanish :D
FyodorNinian
Posts: 55
Joined: Tue Aug 30, 2011 11:40 am

Re: Write an ISO image to USB Hard Disk

Post by FyodorNinian »

gegs wrote:I think you need to reformat your hard disk before trying again. If you've used it before it's probably already got a FAT16 boot sector that's been corrupted. Best to delete all the partitions and start again.

The best way to delete the partitions in Windows (I'm on XP) is to go to Control Panel > Administrative Tools > Computer Management > Disk Management and (sorry for the next All Caps bit) MAKE SURE YOU SELECT THE CORRECT DEVICE IN THE BOTTOM RIGHT PANE! Right click on each partition on the portable drive and delete each one. Now right click and create a new partition taking up the whole disk. You have the opportunity to assign a drive letter here, so make sure you choose the one that will make Windiskimager work with your USB stick.

Google "Gparted" and read up on how to use it. As with Disk Management in Windows (no caps this time) make sure you choose the correct device you want to modify. All the devices won't be visible in the dialogue - you need to choose the correct one from a drop-down menu. Gparted can be run from a Joggler linux distro but it isn't installed by default; however, I use Gparted from a bootable live CD on my PC. You can also use Gparted to delete and create partitions, like in Windows Disk Management (but with more options).

There is a Gparted tutorial here: http://bit.ly/4qvbIU
Gparted live is downloadable from here: http://bit.ly/3hhg
Wikipedia Gparted page (a bit sparse but shows what actions are supported for each filesystem): http://bit.ly/fkQOFt

I would use ext4 for any conventional hard disk based system. BuZz's btrfs images are optimized for solid state devices like USB sticks or SSD drives.
Many thanks Gegs for taking the time to write the above - very much appreciated. I haven't had a chance to look at the tutorial as yet, but certainly intend to. Am feeling more optimistic now about getting my HDD woes sorted :-)
multiplex
Posts: 59
Joined: Wed Aug 24, 2011 8:07 pm
Location: Hampshire, UK

Re: Write an ISO image to USB Hard Disk

Post by multiplex »

If you have the music on an external drive accessed via Samba, then why do you want a USB HDD?

I'm intrigued because I do pretty much the same thing(SqueezeBox server and Player on the Joggler using Ubuntu and music from a NAS) but I use a 4GB USB FLASH stick.
gegs
Posts: 1146
Joined: Fri Mar 04, 2011 3:22 pm
Location: Edinburgh

Re: Write an ISO image to USB Hard Disk

Post by gegs »

multiplex wrote:If you have the music on an external drive accessed via Samba, then why do you want a USB HDD?
I agree that if you have a NAS this might seem like overkill. If you don't have a NAS, you can install Ubuntu on a USB HDD, edit the partitions and add a FAT32 / NTFS partition to store your media files, set up the FAT32 / NTFS partition as a samba share - et voila! - your Joggler is a NAS.

Storing the media on a partition that is accessible from other devices will allow you to unplug it and take your media with you. I format as FAT 32 because I can use the device to back up data from my digital TV recorder - which only supports FAT32 (for some peculiar reason).

I used to have a Seagate drive that was powered by the Joggler but it packed up and has been replaced with a Samsung 750 gig drive. Unfortunately the Samsung requires a powered hub (which is the experience for must Joggler/hard drive users).

----EDIT----
My Samsung didn't need a powered hub after all, just a different hub. It's now working very well.
Last edited by gegs on Thu Mar 22, 2012 12:24 am, edited 1 time in total.
multiplex
Posts: 59
Joined: Wed Aug 24, 2011 8:07 pm
Location: Hampshire, UK

Re: Write an ISO image to USB Hard Disk

Post by multiplex »

gegs wrote:... et voila! - your Joggler is a NAS.
Now that is something that I've thought about!

I get that, but the thought that the entertainment is not critical has stopped that plan - I use a commercial NAS and hope that it will be more reliable than a home built system (but sometimes I wonder, it's just an optimised Linux on an ARM CPU with a bit of customisation)... at least I could have the HDD spin down when idle (which the NAS won't)
User avatar
Mevi
Posts: 774
Joined: Tue Oct 25, 2011 4:39 pm

Re: Write an ISO image to USB Hard Disk

Post by Mevi »

Joggler + HDD + Mevi XP = NAS + media server. :)
I've Got The Moves Like Joggler

Windows XP Professional SP3 plus Tablet PC for O2 Joggler
http://www.jogglerwiki.com/forum/viewto ... ?f=2&t=305

How to build your own Windows XP for the Joggler
http://www.jogglerwiki.com/wiki/WindowsXP
User avatar
asantaga
Posts: 124
Joined: Thu Apr 14, 2011 12:31 am

Re: Write an ISO image to USB Hard Disk

Post by asantaga »

guys,

Quick question, I've been trying to install Xubuntu to a WD500 GB drive, using the flash-swap method, and alas it simply wont boot.. The joggler just hangs at the O2 logo..

Any ideas?

I've tried deleting all partitions and reformatting to no avail...
Angelo
User avatar
BuZz
Site Admin
Posts: 1460
Joined: Fri Mar 04, 2011 1:15 am

Re: Write an ISO image to USB Hard Disk

Post by BuZz »

multiplex wrote:I use a commercial NAS and hope that it will be more reliable than a home built system (but sometimes I wonder, it's just an optimised Linux on an ARM CPU with a bit of customisation)... at least I could have the HDD spin down when idle (which the NAS won't)
if you can get shell access on the nas, you can probably make the hd spin down.
Jarv_77
Posts: 92
Joined: Fri Mar 04, 2011 9:55 am

Re: Write an ISO image to USB Hard Disk

Post by Jarv_77 »

asantaga wrote:guys,

Quick question, I've been trying to install Xubuntu to a WD500 GB drive, using the flash-swap method, and alas it simply wont boot.. The joggler just hangs at the O2 logo..

Any ideas?

I've tried deleting all partitions and reformatting to no avail...
Asantaga, just seen your post above, if this is a still an issue for you I suspect it might be the WD harddrive you are using. I have an externally powered one that auto spins down, to get it to boot into Joli I have to do an on-off-on of the joggler's power. The first 'on' seems to wake the drive up enough for it to be ready to boot at the second 'on'. Not good practice I'm sure but otherwise it hangs on an O2 boot screen.

Thanks also while I'm here to Gegs above for the instructions on writing an image to a HDD. Worked for me. :)

David
Juggler
Posts: 249
Joined: Thu Apr 21, 2011 2:34 am

Re: Write an ISO image to USB Hard Disk

Post by Juggler »

I used WinDiskImager to begin with, then for some reason it wouldn't write an image to a flash drive, so I tried DD for windows :

http://uranus.chrysocome.net/linux/rawwrite/

Edit - a more appropriate link for Win DD is here :

http://www.chrysocome.net/dd

plus it includes docs on usage //Edit

I've found this works a treat. But, and this is a *big but*, there is no hand holding. If you get the hard disk number wrong, you better have a recent image of your hard drive.

For example, what I do is put dd.exe in the same folder as the image to be written. I usually rename the image to be written to something easier to type on the command line.

First thing is to find out the path to the hard drive you want to write to. So enter :

dd --list

then from the results of this, identify the path to the device you want to write to. For the first additional drive, this might be :

\\?\Device\Harddisk1\Partition0

Note, I have found that your PC's main hard drive, if you have just a single hard drive in the PC you are using, will usually be :

\\?\Device\Harddisk0\Partition0

*Make sure you don't write to this one !*

OK, now we know where the image is going, time to get writing. So something like this should do the trick :

dd bs=10M if=u11-10.img of=\\?\Device\Harddisk1\Partition0 --progress

Few points on the above :

* I have used block size of 10M (10 Meg) as it takes a *lot* longer using the default block size of 512K
* --progress is added so you can see how much of the image has been written

When you press enter on the dd command there is no "Are you sure you want to do this" or "Do you realise your about to write to the system hard drive and will really regret doing that". Nope, in true old world UNIX style, it just goes ahead and does it.

When the image is written, if you try to eject/remove the USB hard drive in the safe way, I have found windows will complain. So, I just pull the USB plug out.

Yesterday, I set up a Xubuntu on a hard drive and installed quite a few apps on there. I'm going to have a go with transferring this to a USB flash drive with clonezilla and will see how that goes.

Hope you find this useful. And if you have any further experience or alternatives at writing Joggler images to hard drives, would be good to post it here.
Post Reply