User avatar
Mezo
Posts: 55
Joined: Sun Jan 01, 2012 9:35 pm

Re: PiCard - GUI SD Preparation Tool

Wed Jan 11, 2012 8:57 pm

My USB`s are poxy little ones, im looking for a larger one for such a job, incednetly all those people like me who are going down the Linux road something i may point out to you. Not all USB drives are Linux compatible & the best value for money (albeit not very fast) but who cares is the Kingston Traveller (which is Linux compatible) not that i need it for this task but seems im going down the Linux highway from now on its something you should watch out for when buying any peripheral, does it support Linux? check carefully.

Thanks Liam (now get swatting young man)

Liam Fraser said:


Out of curiosity how large is your USB drive?


liamfraser280
Posts: 354
Joined: Tue Oct 04, 2011 6:53 pm
Contact: Website

Re: PiCard - GUI SD Preparation Tool

Wed Jan 11, 2012 9:16 pm

Had a mock exam this morning, then did a past paper in my free blocks... and another one when I got home... that's swatted enough for one day .

I think the only flash drives that might have issue will be those fancy ones that load up a load of s**te when you plug them in to a Windows box.

Working on the tool now. Should have downloads working very soon and thats one of the crucial parts down . Listing disks is also done (but not yet listing mountpoints for extra safety and also I haven't limited what disks you can choose yet so people don't go and DD to their C drive )

User avatar
Mezo
Posts: 55
Joined: Sun Jan 01, 2012 9:35 pm

Re: PiCard - GUI SD Preparation Tool

Wed Jan 11, 2012 9:31 pm

That`s assuming there OS is on there C drive, my desktop has three drives with different OS on each Liam.

Mezo.

liamfraser280
Posts: 354
Joined: Tue Oct 04, 2011 6:53 pm
Contact: Website

Re: PiCard - GUI SD Preparation Tool

Wed Jan 11, 2012 9:36 pm

Anything larger than 32gig which is the largest SDHC card size is out the window straight away. Any other ideas you can think of to make sure the correct storage device is chosen?

Neil Mayhew
Posts: 9
Joined: Thu Nov 03, 2011 6:15 pm
Contact: Website

Re: PiCard - GUI SD Preparation Tool

Wed Jan 11, 2012 11:22 pm

Writable. As well as eliminating optical drives, it also avoids trying to write to a write-protected card or stick.

User avatar
Mezo
Posts: 55
Joined: Sun Jan 01, 2012 9:35 pm

Re: PiCard - GUI SD Preparation Tool

Wed Jan 11, 2012 11:32 pm

Neil Mayhew said:


Writable. As well as eliminating optical drives, it also avoids trying to write to a write-protected card or stick.



Good one, didnt think of that & im sure Liam will appreaceate that imput, cheers.

Mezo.

liamfraser280
Posts: 354
Joined: Tue Oct 04, 2011 6:53 pm
Contact: Website

Re: PiCard - GUI SD Preparation Tool

Thu Jan 12, 2012 7:53 am

Cheers for that Neil and Mezo

Another day at college now... talk later!

marc
Posts: 48
Joined: Fri Jan 06, 2012 6:40 pm

Re: PiCard - GUI SD Preparation Tool

Thu Jan 12, 2012 8:48 am

Been a bit busy of late with other work.

Going to be busy today with it also, so not got going to be about on here much.

USB Drives not being supportive of Linux are the Encrypted Volumes such as Kingston Secure Devices etc.

Most USB have partition flags set to show they are removable drives unless you partition in Gnome partitioner where you can format the MBR and set the partitions to FAT32 512K BS.

Windows registers all the USB/Flash-Card/Thumb-drives in its registry under removable media.  A simple script should be able to extract theses keys interpret them and allow the program to only use devices listed under this key.

(Helps with identifying usb drives and memory cards omitting usb hdd and local sata ata (IDE) Hdds).

Most Cards even if they cannot be read by Linux can still be accessed by Linux as Device unless its mount encrypted so DD would work as it doesn't check anything on the Card it will just block write, for instance dd if=/dev/zero of=/dev/sdb bs=512K count=1 would wipe the mbr/partition table of the device sdb SD Card in this example.

so dd if=/media/USB/flashfile.img of=/dev/sdb bs=512K would write to SD Card until its full or flashfile.img file is copied to device sdb sdcard.  Leave the rest of the space (if any) as unallocated space.  Not difficult to create user/data partition ext2/3 on there if enough space and have it mounted as /home on boot.

Neil Mayhew
Posts: 9
Joined: Thu Nov 03, 2011 6:15 pm
Contact: Website

Re: PiCard - GUI SD Preparation Tool

Tue Jan 17, 2012 7:29 pm

jojopi said:

I doubt that the R-Pi supports initrd booting at all.
Something re-tweeted recently:

@InSearchOf1230
Learned something new today. The Raspberry Pi boots from its GPU which looks for the kernel and rootfs within a FAT file system via SD card.
So maybe the GPU does support initrd booting after all. Who could we ask?

liamfraser280
Posts: 354
Joined: Tue Oct 04, 2011 6:53 pm
Contact: Website

Re: PiCard - GUI SD Preparation Tool

Tue Jan 17, 2012 7:35 pm

Hi Neil.

I'd highly reccomend you download and take a look the rootfs tar from ArchlinuxARM on Raspberry Pi | Distributions | Forum | Raspberry Pi as the boot folder in this rootfs is what will be on the FAT32 partition.

Will probably clear a lot of things up for you

mobeyduck
Posts: 173
Joined: Tue Nov 29, 2011 6:39 pm

Re: PiCard - GUI SD Preparation Tool

Tue Jan 24, 2012 9:08 pm

You can use WMI objects to see if a device is removable or not.

If you use win32_logicaldisk you get a number code for the drive.





get-wmiobject -class win32_logicaldisk

Now I have basic information about the drives on my computer. I've listed one fixed disk (type 3), one DVD/CD drive (type 4) and one network drive (type 5). I know these drive types because I looked them up.


I'm not 100% certain if that is correct but cant seem to find it any where else..

You could also use the Win32_DiskDrive class.

check: http://msdn.microsoft.com/en-u.....85%29.aspx

like in powershell

get-wmiobject -class Win32_DiskDrive
According to that site InterfaceType can be used, but testing it while typing this it doesnt..

But the output is usable for me it looks like


Partitions : 4
DeviceID   : \.PHYSICALDRIVE0
Model      : ST9250827AS ATA Device
Size       : 250056737280
Caption    : ST9250827AS ATA Device

Partitions : 1
DeviceID   : \.PHYSICALDRIVE1
Model      : USB USB 2.0 Flash USB Device
Size       : 2048094720
Caption    : USB USB 2.0 Flash USB Device



At the moment i cant get the filter to work on model -like "usb" so that would need some more work but if you put the output of this in/next-to the selection screen the chance of getting the wrong drive will be lower.

---edit

At the moment I dont have a SD card so this needs a little check to see it would work for internal and external readers.

liamfraser280
Posts: 354
Joined: Tue Oct 04, 2011 6:53 pm
Contact: Website

Re: PiCard - GUI SD Preparation Tool

Tue Jan 24, 2012 9:30 pm

Hi Mobeyduck!

Thanks very much for that.

I'm using dd for windows to list disks because I'll be using that to do the dd. I will then query WMI with these disk ID's (they are in the same form as WMI. The disk numbers are the same so it works fine .

Wasn't quite sure on how I was going to query this.

Just an update for all:

The reason there has been little activity on this project is because I've had exams the past couple of weeks and now I have computing software development that needs finishing off. The deadline for that is tuesday the 31st of jan. Once that's done I'll be cracking on with this full speed ahead

Cheers,

Liam.

mobeyduck
Posts: 173
Joined: Tue Nov 29, 2011 6:39 pm

Re: PiCard - GUI SD Preparation Tool

Tue Jan 24, 2012 9:40 pm

Your welcome

If I even would write a part of a program that could do all you want I would pass my scripting classes without even having to do an exam

marc
Posts: 48
Joined: Fri Jan 06, 2012 6:40 pm

Re: PiCard - GUI SD Preparation Tool

Tue Jan 24, 2012 10:20 pm

Welcome back guys

Hope your doing well on your exams Liam, I just been turned down on being apart of a web building team because i don't have a degree sigh.

So please bud go the distance and don't be distracted.

Neil Mayhew
Posts: 9
Joined: Thu Nov 03, 2011 6:15 pm
Contact: Website

Re: PiCard - GUI SD Preparation Tool

Tue Jan 24, 2012 10:30 pm

Liam Fraser said:

I'd highly reccomend you download and take a look the rootfs tar from ArchlinuxARM on Raspberry Pi | Distributions | Forum | Raspberry Pias the boot folder in this rootfs is what will be on the FAT32 partition.

Will probably clear a lot of things up for you


Yes, indeed. There is no initrd there.

liamfraser280
Posts: 354
Joined: Tue Oct 04, 2011 6:53 pm
Contact: Website

Re: PiCard - GUI SD Preparation Tool

Tue Jan 24, 2012 10:31 pm

They are going well thanks!

It's a real shame because the fact is, a lot of people without degrees are far better than those with one.

Cheers Marc ,

Liam.

bredman
Posts: 1415
Joined: Tue Jan 17, 2012 2:38 pm

Re: PiCard - GUI SD Preparation Tool

Wed Jan 25, 2012 11:27 am

Liam Fraser said:


Any other ideas you can think of to make sure the correct storage device is chosen?


By far the safest method is to tell the user "Insert your SD card now".

Your code could build a list of attached drives every 5 seconds, waiting for a new drive to appear.

After the drive appears, you could display the size and label and ask for confirmation.

It may be useful to provide an "Advanced…" button to allow the user to pick the drive from a list. Just for the edge cases that somebody will come up with.

mobeyduck
Posts: 173
Joined: Tue Nov 29, 2011 6:39 pm

Re: PiCard - GUI SD Preparation Tool

Wed Jan 25, 2012 12:30 pm

I just remembered a post from, i think it was Gert, it had a little guide on preparing a sd card with dd if im correct they said to use dd -removable or some thing like that so you would only have removable devices in the list.

this site states something semiliar. http://www.chrysocome.net/dd

Safety with --filter=

To prevent accidental overwriting of the wrong disk, a safety filter can be enforced. Available filters are:




fixed
Only write to a fixed disk


removable
Only write to a removable disk


disk
Only write to any kind disk


partition
Only write to a partition



liamfraser280
Posts: 354
Joined: Tue Oct 04, 2011 6:53 pm
Contact: Website

Re: PiCard - GUI SD Preparation Tool

Wed Jan 25, 2012 12:40 pm

Both are good ideas.

@mobeyduck. I'm already using filter=disk because I found that if there is no filter and there are network shares, it takes ages to load each volume.

I'm using disk rather than removable because the unix and mac versions don't have a filter option so I might as well use the same filter code on all of them.

Jaseman
Posts: 302
Joined: Tue Jan 10, 2012 12:59 pm
Contact: Website

Re: PiCard - GUI SD Preparation Tool

Wed Jan 25, 2012 1:01 pm

I'll be watching this thread closely.

We need a fast and easy way to set up linux SD cards for Pi.  As soon as it goes on sale, those are going to be in demand.

HansH
Posts: 214
Joined: Mon Sep 05, 2011 7:49 am

Re: PiCard - GUI SD Preparation Tool

Wed Jan 25, 2012 1:51 pm

Jaseman said:


I'll be watching this thread closely.

We need a fast and easy way to set up linux SD cards for Pi.  As soon as it goes on sale, those are going to be in demand.


Well I reckon that there will be some linux img available for download at the same time.

So it just a matter of putting them on a SDcard, which shouldn't be much of a problem

Jaseman
Posts: 302
Joined: Tue Jan 10, 2012 12:59 pm
Contact: Website

Re: PiCard - GUI SD Preparation Tool

Wed Jan 25, 2012 2:49 pm

Turning the monitor can be a problem for some people.

bredman
Posts: 1415
Joined: Tue Jan 17, 2012 2:38 pm

Re: PiCard - GUI SD Preparation Tool

Wed Jan 25, 2012 3:00 pm

Jaseman said:


Turning the monitor can be a problem for some people.


As a true story, I was manning a telephone helpdesk and a user reported "I can't see my screen".

Assuming there was some problem with the display, I spent several minutes troubleshooting display problems, but the answers from the user were confusing.

Finally, I figured out that somebody had put the display face-down on the table. I should have listened to the exact complaint from the user. The screen wasn't blank, it just wasn't visible.

Moral 1: Users are easily confused by small things.

Moral 2: Experts should listen to users.

User avatar
Montekuri
Posts: 449
Joined: Thu Sep 22, 2011 6:26 pm
Contact: Website

Re: PiCard - GUI SD Preparation Tool

Wed Jan 25, 2012 3:22 pm

HansH said:


Well I reckon that there will be some linux img available for download at the same time.

So it just a matter of putting them on a SDcard, which shouldn't be much of a problem


I agree.

And if this is a ISO img we can just use ISO to USB app to write to a SD card:

http://www.isotousb.com/

We can use a USB Card Reader to write to the SD card:

http://www.amazon.com/Mini-Mem.....038;sr=1-1

User avatar
jojopi
Posts: 3353
Joined: Tue Oct 11, 2011 8:38 pm

Re: PiCard - GUI SD Preparation Tool

Wed Jan 25, 2012 4:06 pm

Montekuri said:

And if this is a ISO img we can just use ISO to USB app to write to a SD card:
The ISO9660 file system is designed to be used on read-only media such as CD-ROMs.  Linux distributions for PCs are often available as ISOs because it is a well supported way to boot an installer or live image on that platform.

RasPis are unlikely to have an optical drive connected and almost certainly do not support booting from one.  So distributions should be released as SD card images and not ISOs.

Return to “Other projects”