Data corruption test when copying over USB - G1 Android Development

Hi,
I'm getting consistent data corruption when I copy data to my G1 over the USB cable. Every time I copy, say, a 50MB file, the md5sum is different compared to the original. It is different every single time:
Code:
mount android; cp 50mb.bin android/; umount android; mount android; md5sum 50mb.bin android/50mb.bin; umount android;
b3b6bef71e9628dc54833663e93ebdc9 50mb.bin
f0ac977696d8c270b2677457b9fd53d4 android/50mb.bin
mount android; cp 50mb.bin android/; umount android; mount android; md5sum 50mb.bin android/50mb.bin; umount android;
b3b6bef71e9628dc54833663e93ebdc9 50mb.bin
1aaa38e015c469fc2c59eeb99729a631 android/50mb.bin
JesusFreke also reported data corruption issues.
Would you please check if your G1 has data corruption by either doing the same command as above (remember to umount after copying!), or doing something equivalent on windows (perhaps with sfv or whatever)?
I'm wondering what percentage of users suffers data corruption and under what circumstances.
Thanks!
Update:
infernix said:
just a heads up for everyone.
i bought two ferrite cores and put them on each end of the USB cable. no more data corruption. equal md5sums every single time.
so in conclusion:
if you experience data corruption, buy ferrite cores and stick them on your usb cable, or use a cable with integrated ones
Click to expand...
Click to collapse

I'm getting the same behaviour on my laptop. A new G1 with RC28 G1 will arrive in a week or so, let's see if it's only happening on some of the G1s.

infernix said:
Hi,
I'm getting consistent data corruption when I copy data to my G1 over the USB cable. Every time I copy, say, a 50MB file, the md5sum is different compared to the original. It is different every single time:
Code:
mount android; cp 50mb.bin android/; umount android; mount android; md5sum 50mb.bin android/50mb.bin; umount android;
b3b6bef71e9628dc54833663e93ebdc9 50mb.bin
f0ac977696d8c270b2677457b9fd53d4 android/50mb.bin
mount android; cp 50mb.bin android/; umount android; mount android; md5sum 50mb.bin android/50mb.bin; umount android;
b3b6bef71e9628dc54833663e93ebdc9 50mb.bin
1aaa38e015c469fc2c59eeb99729a631 android/50mb.bin
JesusFreke also reported data corruption issues.
Would you please check if your G1 has data corruption by either doing the same command as above (remember to umount after copying!), or doing something equivalent on windows (perhaps with sfv or whatever)?
I'm wondering what percentage of users suffers data corruption and under what circumstances.
Thanks!
Click to expand...
Click to collapse
Unfortunately my datapoint won't be directly relevant to your methodology as I do my data management in xp, but I have experienced no data corruption as of yet (Transferred multiple gigabytes of mp3 through the usb mount and verified against previously generated md5 sums). Have you tried extracting the files back to your PC and finding the difference? It might help to troubleshoot the problem by knowing where the file is differing from the original.

Just did a few tests and I'm not seeing any data corruption issues with my setup:
G1: JesusFreke's modified RC30, 8GB SD card
PC: Fujitsu laptop running Ubuntu Hardy (8.04)
I tried copying a 50MiB zero-filled file, and also tried 50MiB of arbitrary data (actually the first part of a large tar.gz I had lying around) and both checked out fine with md5sum after an umount/mount..

I also spoke with Infernix about my corruption issues. But just to put it "out there", I have occassionally seen some files get corrupted when I copy them to the sd card. I've seen it happen both when the sdcard is mounted via USB, and also when using adb push. So I've gotten in the habit of doing an md5sum of an update before I try to apply it.
I've noticed that USB is practically unusable if I have my BT dongle plugged into my computer near the USB cable, for example if I have them both plugged into the front of the computer. But I have my BT dongle plugged into the back of the computer, and the G1 into the front, it seems to work decent.
Another problematic setup I noticed was if I tried to use a USB extension cord (maybe 3-4, not like a super long one), I seemed to have significantly more USB issues as well.
So I'm guessing the cord is picking up EM interference and causing bits to be corrupted.
I can think of a number of possible workarounds to the issue:
- Modify adb and the adb daemon so that it will detect corrupted "packets" and re-transmit.
- Host whatever files you want to put on your G1 on a webserver with the extension .xxx and download them via the browser instead.
- use some sort of "secure copy" program to copy the files to the sdcard when mounted via usb. There is more than likely something like that out there that would work, I just don't know of anything off the top of my head.

JesusFreke said:
So I'm guessing the cord is picking up EM interference and causing bits to be corrupted.
Click to expand...
Click to collapse
Are you guys using usb cables with ferrite cores on em?

jashsu said:
Are you guys using usb cables with ferrite cores on em?
Click to expand...
Click to collapse
/me checks end of cable.
Yup, pretty good sized one on there.
TBH, the data corruption issues might have just been occuring when I had used another cable I have laying around, that I don't think has one. I don't remember for sure if I have had any data corruption with this one or not.

Code:
[email protected]:~/qBT_dir/Saw.V.R5.LINE.XviD-COALiTiON$ sudo mount /dev/sdb1 /media/disk
[email protected]:~/qBT_dir/Saw.V.R5.LINE.XviD-COALiTiON$ sudo cp coa-saw5-r5.avi /media/disk
[email protected]:~/qBT_dir/Saw.V.R5.LINE.XviD-COALiTiON$ sudo umount /media/disk
[email protected]:~/qBT_dir/Saw.V.R5.LINE.XviD-COALiTiON$ sudo mount /dev/sdb1 /media/disk
[email protected]:~/qBT_dir/Saw.V.R5.LINE.XviD-COALiTiON$ md5sum coa-saw5-r5.avi
66ed3515a533885f436768106cdaf6b1 coa-saw5-r5.avi
[email protected]:~/qBT_dir/Saw.V.R5.LINE.XviD-COALiTiON$ md5sum /media/disk/coa-saw5-r5.avi
fe6c396c9ad3199d1dcaa020023753f3 /media/disk/coa-saw5-r5.avi
[email protected]:~/qBT_dir/Saw.V.R5.LINE.XviD-COALiTiON$
That is scary.
Edit:
Code:
[email protected]:~/qBT_dir/Saw.V.R5.LINE.XviD-COALiTiON$ cp /media/disk/coa-saw5-r5.avi coa-saw5-r5.avi.2
[email protected]:~/qBT_dir/Saw.V.R5.LINE.XviD-COALiTiON$ md5sum coa-saw5-r5.avi /media/disk/coa-saw5-r5.avi coa-saw5-r5.avi.2
66ed3515a533885f436768106cdaf6b1 coa-saw5-r5.avi
fe6c396c9ad3199d1dcaa020023753f3 /media/disk/coa-saw5-r5.avi
fe6c396c9ad3199d1dcaa020023753f3 coa-saw5-r5.avi.2
Copying from USB to PC doesn't seem to do it...?

No wonder all my images get corrupted when i transfer from G1 to PC. I end up with half images and sometimes unreadable ones.
For example....

just a heads up for everyone.
i bought two ferrite cores and put them on each end of the USB cable. no more data corruption. equal md5sums every single time.
so in conclusion:
if you experience data corruption, buy ferrite cores and stick them on your usb cable, or use a cable with integrated ones

infernix said:
i bought two ferrite cores and put them on each end of the USB cable. no more data corruption. equal md5sums every single time.
Click to expand...
Click to collapse
The principal source of the RF is probably the computer, so most data cables for small electronics only have one ferrite core near the terminal end for the computer. One core should be sufficient.

I'm glad someone else was having this problem I felt baffled by it. I was looking forward to using phone as storage medium but kept getting errors durring large transfers. Do you think the RF from the phone itself may be the problems since I can use longer cables for eternal drive copy, or is it simply a power vs signal fragility problem?

Related

SD"2" Mount Issue

My first thread that I can call my own.
Question for you all. Is there an easier way to transfer files over the the GTAB then having to pop out the SD Card and put it into an adapter and then into the computer and then out of the computer, out of the adapter and back in the GTAB?
Because every time I mount the USB, it only mounts the "internal" SD Card. Is there some sort of way to get it to mount both the internal and external SD Card?
I hate messing with the external SD Card. All the "popping in and out" makes me nervous.
I even tried mounting the internal SD Card and then copying the movies/music/etc.. over to the external SD Card via a file manager... but that is DAMNNNNN slow.
I haven't found a way (yet). Given that neither the zPad or TnT stock builds work, I'm thinking it's not that easy to do. Drives me nuts as well because I really don't want to keep taking the card out over and over and potentially damage it, over time.
That's exactly what I am worried about. LOL
I can just picture not paying 100% attention and snapping the card in half or, breaking the "locking" mechanism that holds the card in place.
roebeet said:
I haven't found a way (yet). Given that neither the zPad or TnT stock builds work, I'm thinking it's not that easy to do. Drives me nuts as well because I really don't want to keep taking the card out over and over and potentially damage it, over time.
Click to expand...
Click to collapse
If you have ADB, can you do adb pull or push?
Jim
My workaround has been to use the LAN tab in ES File Explorer to copy data wirelessly to sdcard2. Probably not the speediest method but it keeps the card in place.
The techie/hacker solution to easy file transfer is to use the Rsync for Android app in the market store. Once you have it setup, (not the easiest thing to do) it works great for moving files automated from your gtab back to an rsync server (my linux box to the rescue). I even have a secondary profile to get it to reverse rsync a specified directory FROM my linux box to my gtab. Presto -- easy file transfer via wifi!!!
Also, another idea might be to use Dropbox?
Jim
P0RT3R said:
My workaround has been to use the LAN tab in ES File Explorer to copy data wirelessly to sdcard2. Probably not the speediest method but it keeps the card in place.
Click to expand...
Click to collapse
I do the same thing. It's mighty slow, but it works.
roebeet - an idea that almost worked - maybe you know why?
roebeet said:
I haven't found a way (yet). Given that neither the zPad or TnT stock builds work, I'm thinking it's not that easy to do. Drives me nuts as well because I really don't want to keep taking the card out over and over and potentially damage it, over time.
Click to expand...
Click to collapse
Hi,
You all got me curious, so I just tried the following:
- Created a dir under /mnt/sdcard, /mnt/sdcard/mymnt
- Get temp root (z4root)
- Start terminal
- su
- mount -t vfat /dev/block/vold/179:17 /mnt/sdcard/mymnt
At this point, I can access the sdcard2 by using /mnt/sdcard/mymnt or simply /sdcard/mymnt.
So, I disabled USB debugging, and I get the popup asking if I want to activate USB transfer (I'm on 3452, on earlier TNT firmware, it use to say enable USB storage).
I click the button to Activate, and then another window pops up, and I click Activate.
Then, the popup just stays there, with the spinning thing. It never enables USB transfer, and, on my PC, I see the removable drive, but when I click on it, it says it's not ready.
I've also tried umounting /mnt/sdcard2, thinking that it might be confused because of the two mounts to /dev/block/vold/179:17, but it still does the same thing.
So:
- It looks like I can mount the /dev/block/vold/179:17 (the external microSD card) under /mnt/sdcard, and
- When I do that mount, I can see the contents of the external microSD card in terminal under /mnt/sdcard/mymnt and under /sdcard/mymnt, but
- For some reason, turning off USB debugging/activatiing USB transfer fails.
Maybe someone can figure out why activating the USB transfer fails. If we can figure that out, then that would allow seeing the external microSD card via the PC USB interface.
Jim
I think it would need to mount both volumes -- the internal SDcard and the external SDCARD2 -- separately...
Using a mount (reparse) works internally since they are on the same device -- but if you try to mount SDCARD externally it doesn't understand the reference to SDCARD2
My phone actually mounts to the computer as two drives -- one for internal (SDCARD) and the other for external (SDCARD2)
I'd assume there is a way to have something similar work on our gTablets...
I'll have to slap a spare microSD card into the tablet to try though...wondering if teh INF needs to be tweaked as well (??)
From what Ive seen or experienced, Cyanogen was the only rom that Had the Sd card and Sd card2 Thing fixed right (with exception of having to plug in the Power cord before mounting). Evrey other Rom seems to have problems. But Cyanogen has way too many other problems so I use Vegan since to me it seems the most stable :s
Yeah -- my phone is running a fork from Cyanogenmod 6...so the code is shared
TeutonicWolf said:
I think it would need to mount both volumes -- the internal SDcard and the external SDCARD2 -- separately...
Using a mount (reparse) works internally since they are on the same device -- but if you try to mount SDCARD externally it doesn't understand the reference to SDCARD2
My phone actually mounts to the computer as two drives -- one for internal (SDCARD) and the other for external (SDCARD2)
I'd assume there is a way to have something similar work on our gTablets...
I'll have to slap a spare microSD card into the tablet to try though...wondering if teh INF needs to be tweaked as well (??)
Click to expand...
Click to collapse
That's the problem... When the Gtab is plugged into the PC USB (while USB debug is disabled), only one new "drive" appears, corresponding to /sdcard on the Gtab. There is no 2nd drive appearing on the PC corresponding to /sdcard2 on the Gtab.
I've been looking at my Windows configuration, with the Gtab plugged in, and the one drive that appears shows up under "Portable Devices" branch in Device Manager. The properties show that it corresponds to "wpdfs.inf", and looking through that, it looks like a generic USB Mass Storage configuration, i.e., a USB drive.
I still think that something would need to be fixed on the Gtab end for the two drives to appear on the Windows end.
Jim
app fix
I have found a workaround for the issue with the installation of a single app:
http://forum.xda-developers.com/showpost.php?p=12299831&postcount=2
Depending on what you want to do, an FTP solution is also possible as discussed in this thread:
http://forum.xda-developers.com/showthread.php?t=869844
By using swiFTP, I am able to open a connection through a Win7 windows explorer, and I can drag-and-drop files to SDCARD2 (over a wireless connection). I put a 1Gig movie on the card and it took about 12 minutes.
Another option is to use Multi Mount SD-Card. This is link is for the lite version, there is also a paid version.
This app works outside the embedded SD Card Mounting scheme that comes with Froyo.
With this you dont have to press the "Mount USB" button that comes up in the notification bar when you attach the USB cable. Instead it will auto-mount the either the internal or the external SD Card when you plug in the cable.
(Having configured the setting of your choice before hand).
Unfortunately it can not mount both at the same time.
It works with my GTAB and I'm using VEGAn 5.1 Beta.
(Without the 5.1.1 Suppliment patch)
Folks are still struggling with this?
Use a USB flash drive, I do it all the time. Just a regular, boring, Windows FAT-formatted flash drive.
Wow it is amazing that this problem still exists.
I am a new owner of a Gtab and have had it for less than 2 days. Thank goodness for the many informative posts on this site, that have helped me make my new toy almost perfect.
I updated to 3588, installed cwm and titanbackup, vegan5.1.1 including the suppl patch and even learned how to tether it to my Samsung Captivate. The one thing that was annoying me was my device not seeing the 16 gb microsd card that I had inserted both in the gtab and on my pc.
After reading this thread, it looks like I am not going crazy, but it seems like my device is destined to not acknowledge this addtional storage in it's settings?
I really was hoping to use the external card for videos and my mp3 collection, so I am missing something or did I do something wrong to make this happen?
I would appreciate any comments or suggestions since this is the only thing that I need to get squared away before I install more apps(with the possibility and ever present threat of having to re-install something I may have already done)
I could not post this question in the dev section since I do not have enough posts to allow me to.
Thanks
Tina

[Q] Mounting multiple usb drives via hub

So, I have a USB hub and a couple flash drives. Everything "works" fine. I say it like that because the hub functions fine, and the first drive you plug in mounts to /usbdrive just fine. The issue is with the second. When you plug in the second drive, Android sees it in /dev/block as sdb1, and using the Terminal app I can manually mount the drive and use it.
Ideally though, it'd be nice if there was a way for Android to see the second drive and automatically (dis)mount it to something like /mnt/sdcard/external. Is this something that can be configured in the system?
What about the way Android detects and mounts an initial flash drive currently? Does anyone have any knowledge of how that's working currently? Perhaps that could just be duplicated to work with a second one?
This might help.
http://forum.xda-developers.com/showthread.php?t=952456
I'm not sure that's quite right. From what I'm seeing, that tool is designed to let you mount existing media on your device in a way that makes it available to a PC. I'm just wanting the tablet to mount a second USB drive so that it's available on the device itself.

[Guide] USB Host

USB host lets you hook up external USB devices to your phone, like a keyboard, mouse, USB drive, etc..
Unlike devices which are designed to support USB host, the One S doesn't provide power to the peripheral. That means we need a few more adapters/cables to get it to work (and we need an external power source).
Purchase links are listed for all the required cables/adapters.
You will need:
USB Host adapter (The otherwise unused 5th pin on a micro-usb connector is grounded) dx.com/m-129671
Mini USB power Y cable (this kind of cable is often packaged with portable hard drives) dx.com/u-65630
Mini USB Female to USB A Female adapter This package comes with two, but you only need one. dx.com/u-55613
Your charger
Assemble the cable:
The micro USB of the "USB Host adapter" connects to your phone.
Your peripheral plugs into the female end of the "Mini USB Female to USB A Female adapter"
The "Mini USB power Y cable" has three connectors:
Mini USB connector - connects to the "Mini USB Female to USB A Female adapter"
Male USB A Power (the thinner wire) - connects to your charger
Male USB A - connects to the "USB Host adapter"
That's all. As long as your ROM supports the peripheral, it will work.
Some fun peripherals to try:
Powered USB hub (You can also power the adapter from one of the hub's ports)
Keyboard
Mouse (a cursor will appear on your device)
USB flash drives and USB hard drives must be FAT32. You have to run a few commands to use a USB drive. Mount manually from the shell (use Connectbot or Terminal Emulator):
Code:
su
mkdir /mnt/sdcard/usb
mount -o uid=1000,gid=1015,fmask=0702,dmask=0702 /dev/block/sda1 /mnt/sdcard/usb
To unmount:
Code:
su
umount /mnt/sdcard/usb
Hello,
I'm French so please excuse me for my english.
Just one question.
I understand nothing with custom ROMs (and i don't want to modify the phone).
Do i need to do something on the phone or your solution with only a couple of cables, an adaptor, a power (i mean a battery like a TeckNet Dual-Port 7000mAh) AND my micro sd card reader (USB), all that will be sufficient to make the deal? I mean i will be able to read the files (.flac music files) of the micro sd or sd card?
Thank you
mrufino63 said:
Hello,
I'm French so please excuse me for my english.
Just one question.
I understand nothing with custom ROMs (and i don't want to modify the phone).
Do i need to do something on the phone or your solution with only a couple of cables, an adaptor, a power (i mean a battery like a TeckNet Dual-Port 7000mAh) AND my micro sd card reader (USB), all that will be sufficient to make the deal? I mean i will be able to read the files (.flac music files) of the micro sd or sd card?
Thank you
Click to expand...
Click to collapse
A battery pack (like the TeckNet) should work as the power source.
For Keyboard/mouse, you do not need to modify the phone. (Only the cables and power are needed.)
For a card reader, you must "root" the phone, because to 'mount' the USB drive, you must run 'su'.
So i'd have to root the HTC One S to mount external flash memory cards!
What a pity to sell phones without micro sd emplacement (so they sell you. mp3 players).
I have a 64gb micro SDXC in my HTC Desire (bravo) which works perfectly...
HTC will wait... (Perhaps i will root that one: i must learn how to do...)
Nice from you to answer me - specially on xda-developers site, i mean where the members speak of more interesting problems, like development, etc.
Thank you again
Is this part right?
Code:
mkdir /media/sdcard/usb
My phone doesn't have a media directory. Plus on your next line you mount /mnt/sdcard/usb.
Thanks for the write up. Tried with a powered hub and couldn't get it to work. Going to order the cables I listed below and give it a shot. If I store and access movies/music from an external drive for travel that would be awesome! Will use this for power source on the plane!
Also, for other options for what to purchase you can bring it down to 2 items with these.
1 - Y-cable with female end instead of mini usb.
2 - Micro to female "host" cable. Same as what you linked, just a different place to buy so order is from same site (cheaper shipping!).
setzer715 said:
Is this part right?
Code:
mkdir /media/sdcard/usb
My phone doesn't have a media directory. Plus on your next line you mount /mnt/sdcard/usb.
Click to expand...
Click to collapse
Yes, it should be "mkdir /mnt/sdcard/usb". I'm updating the post now.
nerd65536 said:
Yes, it should be "mkdir /mnt/sdcard/usb". I'm updating the post now.
Click to expand...
Click to collapse
Yeah, that's what I figured. Thanks for updating the post.
Were you able to mount a flash drive doing this? If so, could you stream a movie from it? Just curious what all you have done with this mod.
Thanks again for the write up. I always though the issue was that the tech was not included in the kernel, not that we didn't have a powered port!
setzer715 said:
Yeah, that's what I figured. Thanks for updating the post.
Were you able to mount a flash drive doing this? If so, could you stream a movie from it? Just curious what all you have done with this mod.
Thanks again for the write up. I always though the issue was that the tech was not included in the kernel, not that we didn't have a powered port!
Click to expand...
Click to collapse
I am able to mount a flash drive and play movies from it. I also tested using a USB keyboard and a USB mouse.
Note: It is best to use a fast charger (1 amp or more) for powering the arrangement. The phone can charge when everything is plugged in.
nerd65536 said:
I am able to mount a flash drive and play movies from it. I also tested using a USB keyboard and a USB mouse.
Note: It is best to use a fast charger (1 amp or more) for powering the arrangement. The phone can charge when everything is plugged in.
Click to expand...
Click to collapse
Awesome, thanks! Just ordered some cables, cant wait to try it out!
So I have been playing with this for a bit. I can get it to mount my old 4GB USB 2.0 flash drive but not my new 32GB USB3.0 flash drive. Do you think it's a 32GB thing or a USB3 thing? I would like to order a new drive for this but not sure which to eliminate.
I would prefer to use a 32GB drive if it's just a USB3 thing but if it's the size of the drive I don't want to deal with returns.
Any ideas?
Also it will not mount my SDCard reader with 16GB card in it.
EDIT: So I found my old 16GB USB3 flash drive and it mounts that just fine. So it's looking like it just won't mount a 32GB drive. Of course my 32GB drive is a super fast USB3 (write speeds of 100Mbps+) so maybe that could have something to do with it. Either way my 16 gig is good enough for travel so I'm good.
Thanks again for the write up!
setzer715 said:
So I have been playing with this for a bit. I can get it to mount my old 4GB USB 2.0 flash drive but not my new 32GB USB3.0 flash drive. Do you think it's a 32GB thing or a USB3 thing? I would like to order a new drive for this but not sure which to eliminate.
I would prefer to use a 32GB drive if it's just a USB3 thing but if it's the size of the drive I don't want to deal with returns.
Any ideas?
Also it will not mount my SDCard reader with 16GB card in it.
Click to expand...
Click to collapse
I'm able to use a 32GB MicroSDHC card in a MicroSDHC-USB adapter.
In principle, a USB 3.0 device should be backwards-compatible, but I don't have any to test with.
Troubleshooting:
Do you get a specific error when using the "mount" command? If so, please paste the error message here.
Run
Code:
ls /dev/block/
to see whether the device "/dev/block/sda" is detected. How many numbered "sda*" entries are listed?
Does the phone charge while everything is plugged in?
nerd65536 said:
I'm able to use a 32GB MicroSDHC card in a MicroSDHC-USB adapter.
In principle, a USB 3.0 device should be backwards-compatible, but I don't have any to test with.
Troubleshooting:
Do you get a specific error when using the "mount" command? If so, please paste the error message here.
Run
Code:
ls /dev/block/
to see whether the device "/dev/block/sda" is detected. How many numbered "sda*" entries are listed?
Does the phone charge while everything is plugged in?
Click to expand...
Click to collapse
The error I get is "No such file or directory". It happens on this and my sdcard reader.
I ran ls /dev/block. With the 16gb flash drive I see sda and sda1. With my 32GB I only see sda.
My 32GB flash drive is a high speed Lexor. I tried my wifes flash drive, her's is a Lexor 32GB USB3 but a slower rated one and I can see her's.
Further testing with my SDCard reader. I have a Transcend 8GB Class 6, A-Data 16GB Class 6 and Patriot 32GB Class 10 SDCards. I can see the 8GB and 32GB but not the 16GB.
Seems maybe a compatibility issue maybe? The card's/drives I couldn't read I tried formatting again, everything is FAT32. Who knows. At least I know most things work.
setzer715 said:
I ran ls /dev/block. With the 16gb flash drive I see sda and sda1. With my 32GB I only see sda.
Click to expand...
Click to collapse
The drive is detected by the phone, but the lack of a "sda1" entry means that the drive does not have a standard partition table. In that case, it should work if you specify "/dev/block/sda" instead of "/dev/block/sda1" in the mount command.
(The ideal solution would be to partition and format the drive so that it would behave like the others.)
nerd65536 said:
The drive is detected by the phone, but the lack of a "sda1" entry means that the drive does not have a standard partition table. In that case, it should work if you specify "/dev/block/sda" instead of "/dev/block/sda1" in the mount command.
(The ideal solution would be to partition and format the drive so that it would behave like the others.)
Click to expand...
Click to collapse
Thanks but what do you mean "partition and format" with a flash drive? Are you saying there should be more than one partition and there isn't? I've formatted the flash drive a few time in windows always as fat32. Is there another way I should do it?
I have an Ubuntu Live CD if you think I should do it in Linux but I'm VERY new to Linux and have no clue as to what commands to use to accomplish this.
setzer715 said:
Thanks but what do you mean "partition and format" with a flash drive? Are you saying there should be more than one partition and there isn't? I've formatted the flash drive a few time in windows always as fat32. Is there another way I should do it?
I have an Ubuntu Live CD if you think I should do it in Linux but I'm VERY new to Linux and have no clue as to what commands to use to accomplish this.
Click to expand...
Click to collapse
It is possible to skip the partition table altogether and just start with the FAT32 data instead. This is what the manufacturer of the drive has done. (The drive doesn't have any partitions, so there is no first partition to be named "/dev/block/sda1")
You should be able to use the drive if you mount "sda" instead of "sda1". You can follow these instructions below to make it behave like the other drives:
If you have an Ubuntu LiveCD, boot from it, and open GParted (Partition Editor):
Choose your flash drive from the drop-down at the top right. Make absolutely sure you select the correct device (the size of the drive is listed), as all data on it will be erased.
In the menu: Device --> Create Partition Table... --> Apply.
Click on the "unallocated" space, to select it.
Next, menu: Partition --> New --> File system: FAT32 --> Add.
Finally, menu: Edit --> Apply All Operations
(When finished, close GParted and shutdown the liveCD)
The drive should now show up with the expected /dev/block/sda1 partition.
I just mounted it as you previously described on sda instead of sda1 and it worked fine. I don't want to repartition it as I don't know if that will mess with the speeds. Who knows what Lexor did to make this thing so amazing fast but I want to keep it that way. It's nice to through 8gigs of movies on it in 1-2 minutes.
I'm sure partitioning has nothing to do with it and it's all based on hardware but you never know!
Would this work using a simple 5-pin male micro-USB to female USB adapter connected to a powered USB hub?
Just ordered an HTC One S. YAY!
I'm a little scared about potentially frying my new toy by using the wrong cables...
Would an all in one cable do the job?
(ebay search for "Micro USB Host OTG Cable With USB power")
Seems to be the same as the DIY setup mentioned in the OP just all wrapped up in a single cable.
Thanks,
Mark
I'm think if we buy an extended battery which have a micro usb cable (I forget the brand) exist on amazon.
We can solder a female to the cable and use battery as power source for phone and host.
What u think???
Sent from my One Sinderella using Tapatalk 2
Hi everybody,
First of all sorry for my englisch. I have a big problem with the USB otg function. An USB mouse works well but USB drives don't work. I have copied the text from terminal emulator:
[email protected]:/ $ export PATH=/data/local/bin:$PATH
[email protected]:/ $ su
[email protected]:/ # mkdir /mnt/sdcard/usb
mkdir: can't create directory '/mnt/sdcard/usb': File exists
2 /dev/block/sda1 /mnt/sdcard/usb <
mount: mounting /dev/block/sda1 on /mnt/sdcard/usb failed: No such file or directory
255|[email protected]:/ #
I also tried sda instead of sda1. No difference.
Please could anybody help me.

[Q] boot from microSD

is that possible? i can't see the kernel panic i'm getting...get a bunch of 'CPU X stopping ... swapper not tainted" errors that flush the screen
if i boot with kernel and no 'root=mmcblk1p2' i do see a 'mmc -110 error' which i've read is a timeout, and it goes to the internal mmc
and i see there are ppl complaining about sd problems on here...
using a 'sandisk pixtor 32gb' (class 10) - don't have a card to test if it's the card
update - cmdline 'maxcpus=1' ftw
'initramfs unpacking failed: junk in compressed archive'
and not mounting like i thought
'mounting /dev/mmcblk1p2 on /newroot failed: no such file or directory'
update again - no sd
edited init to ls /dev...no sd card under there...not sure what the initramfs error is but i'll ignore it..
would still like to know if anyone has had success (maybe w/ a diff card?) booting on SHIELD
Booting a userspace stored from a microSD is possible, yes. However, the kernel itself must be on the internal memory (or sideloaded using fastboot). SHIELD's bootloader does not support booting a kernel directly off a microSD card, unfortunately.
The CPU errors are because Trusted Foundations support is not enabled in your kernel. It is required for booting secondary CPUs. What kernel are you trying to boot? Android or Linux? Which branch?
The CPU errors are because Trusted Foundations support is not enabled in your kernel. It is required for booting secondary CPUs. What kernel are you trying to boot? Android or Linux? Which branch?[/QUOTE said:
yours - https://github.com/linux-shield/kernel
do have a blank 'login screen' for gentoo - however that doesnt work, and i got this for the purpose of the quad-A15 vs my dual chromebook
so i'd hate to chroot compile half the system on my chromebook
I will try to boot to mmcblk0 instead of 1 with the SD inserted.
Click to expand...
Click to collapse
it seems even with the newer 'roth_next' kernel - sd still doesn't seem to show up at boot
going to guess that it's my card...
if anyone can test the steps at https://github.com/linux-shield/kernel/tree/roth_next and edit the https://github.com/linux-shield/bbinitramfs init to 'ls /dev' (if you mount a bogus root it will fail) to see if you can notice any other mmcblk# - that'd tell for sure
going to see if i have a non-sandisk laying around and test if it will show up
What type of SD are you using exactly? (SDHC, XDHC?). For use with upstream kernel I would not go beyond SDHC 32GB.
The steps on my Github page should be correct, I did them myself many times. The initramfs can be a pain in the ass sometimes, I did it for people who want to be able to keep using Android. If this is not your case, and you don't mind borking your user data partition, you can put your root filesystem on /dev/mmcblk0p12 and boot directly to this (root parameter of the kernel). This gives the best performance and is the easiest to set up, but after that Android won't start.
Then if you have a USB network adapter that you can connect to a hub along with your keyboard, you should be able to import stuff easily to your SHIELD's root (without using SD), using just rsync. This should be more comfortable than using a SD card as root, actually.
Anyway, your SD card should at least show up as /dev/mmcblk1 when inserted after boot. If you want to validate it once and for all, try the following:
- boot using my bbfs (not bbinitramfs) filesystem using fastboot (fastboot boot zImage_dtb ramdisk.img.gz). This will get you to a shell without any physical storage mounted, and you will be able to use a USB keyboard.
- insert your SD card and wait ~5 seconds. Check that /dev/mmcblk1 had been created.
- if not, check any kernel error message using dmesg.
By the way, have your problems with CPUs been solved by using tegra_roth_defconfig? Are you able to see all 4 cores now?
All 4 cores was the problem in (not) seeing the init failing to mount root (it flooded 'CPU X stopping' - 4 times)
I believe my sandisk is SDHC (UHS-I <- that's an 'i' )
Looks like the problem is my card - found some 4GB (lower speed i'm guessing) and i do see a mmcblk1 and 0 (1 being my card, 0 being internal) at boot. Also my other sandisk card (16GB) does not show up; it is the same type of card.
Guess i'll have to nuke and backup the android partition =/ or eat the money and buy a different card and hope it works...(16 should be fine for almost everything, but 32 leaves space for compiling some bigger programs, which i really don't need i guess...)
My keyboard doesn't work when i plug it into the usb with a female converter (SHIELD > microUSB cable > female-female < keyboard) think i need a USB OTG cable. Once i get that i can login to gentoo and try to mess around
Yeah, you will need an OTG cable to get your keyboard to work. I suggest connect the OTG cable to a self-powered USB hub, and then plugging your keyboard, mouse, and network adapter there. If you get a powered OTG cable (like this one: http://www.amazon.com/Estoreimport-Micro-Cable-Power-Samsung/dp/B00C4521R4 ) you should even in theory be able to charge your SHIELD while using all these peripherals by plugging the big male port into your hub as well. But that will require another patch to the kernel - I plan to get this done at some point, just not immediatly.
I *think* Android will work just fine with a Linux root filesystem on your (ext4-formatted) data partition, it is just going to put its own directories in there and you will end up with Android directories at the root of your Linux filesystem. If this doesn't bother you, this is also an option. You will have to reformat your data partition to ext4 in any case. SD card support is kind of unreliable in my experience and also slower than MMC, unfortunately.
T_T *sigh*
so got my OTG...keyboard = awesome, rt28xx (alfa) wifi works
but reinserting my SD UHS, just results in the same -110 error about failing to initialize. still the same only mmc0 in /dev
i don't think the tegra SD drivers are working, but i don't do a whole lot of driver programming.
clearly the card works in android. so comparing the 2 drivers may help me understand. but i'm going to bkup and nuke the /data and install there.
so in the end...32GB card is good for backup..not that i 'need' to do that
bl00dy said:
T_T *sigh*
so got my OTG...keyboard = awesome, rt28xx (alfa) wifi works
but reinserting my SD UHS, just results in the same -110 error about failing to initialize. still the same only mmc0 in /dev
i don't think the tegra SD drivers are working, but i don't do a whole lot of driver programming.
clearly the card works in android. so comparing the 2 drivers may help me understand. but i'm going to bkup and nuke the /data and install there.
so in the end...32GB card is good for backup..not that i 'need' to do that
Click to expand...
Click to collapse
Yeah, the upstream SD driver is clearly behind the Android one. That or I did a poor job in the SHIELD's device tree.
Well, actually since you have a USB hub, and USB works at boot already, you can also use a USB mass storage device as your root filesystem. That would certainly work and you won't have to bork your /data partition.
Gnurou said:
Yeah, the upstream SD driver is clearly behind the Android one. That or I did a poor job in the SHIELD's device tree.
Well, actually since you have a USB hub, and USB works at boot already, you can also use a USB mass storage device as your root filesystem. That would certainly work and you won't have to bork your /data partition.
Click to expand...
Click to collapse
not sure what it is, haven't looked.
nope...used and mounted as sda - was a PAIN. anything mounted on USB OTG kept getting errors and saying it couldn't be read
so i eventually found a card i haven't used in forever...cp'd my root.img gentoo to that. cp'd that sd card to mmcblk0p12. finally after hours of moving data around i got a functional booting shield...
but of course like you said, it doesn't charge while running, so i have to keep moving the keyboard/power around. it dies in the middle of compiling and it doesn't like that =/
i'd distcc to make it faster...but i want to make sure it doesn't die. so i'll leave it on power and wait overnight to see what all it can compile
bl00dy said:
not sure what it is, haven't looked.
nope...used and mounted as sda - was a PAIN. anything mounted on USB OTG kept getting errors and saying it couldn't be read
so i eventually found a card i haven't used in forever...cp'd my root.img gentoo to that. cp'd that sd card to mmcblk0p12. finally after hours of moving data around i got a functional booting shield...
but of course like you said, it doesn't charge while running, so i have to keep moving the keyboard/power around. it dies in the middle of compiling and it doesn't like that =/
i'd distcc to make it faster...but i want to make sure it doesn't die. so i'll leave it on power and wait overnight to see what all it can compile
Click to expand...
Click to collapse
It should be possible to charge your SHIELD while using it as a USB host with a Y cable to provide power to the SHIELD and some more kernel hacking. Let me know if you really need it, if so I will try to find the time to implement it (it should work *in theory*, but no guarantee of course).
---------- Post added at 11:15 AM ---------- Previous post was at 11:11 AM ----------
Gnurou said:
It should be possible to charge your SHIELD while using it as a USB host with a Y cable to provide power to the SHIELD and some more kernel hacking. Let me know if you really need it, if so I will try to find the time to implement it (it should work *in theory*, but no guarantee of course).
Click to expand...
Click to collapse
Actually if you have such a Y cable, try to connect it so the SHIELD gets powered - it might be working already since the orange led lights up when you do so. I haven't kept mine long enough in this situation to know if this means the battery is actually charging though. :silly:
hm...
so i'm looking at the dev tree...
Code:
/* SD card */
[email protected] {
status = "okay";
bus-width = <4>;
vmmc-supply = <&vddio_sdmmc3>;
cd-gpios = <&gpio TEGRA_GPIO(V, 2) GPIO_ACTIVE_LOW>;
power-gpios = <&gpio TEGRA_GPIO(H, 0) GPIO_ACTIVE_HIGH>;
};
and i found a few things...like http://comments.gmane.org/gmane.linux.kernel.mmc/21564
and https://en.wikipedia.org/wiki/Secure_Digital
which says...
Cards that comply with UHS show Roman numerals 'I' or 'II' next to the SD card logo,[23] and report this capability to the host device. Use of UHS requires that the host device command the card to drop from 3.3-volt to 1.8-volt operation and select the 4-bit transfer mode.
Click to expand...
Click to collapse
i'm guessing that's why my card wont work?
have things compiling right now... but i figure i dont mess with low level kernel that much. may want to make sure it looks right to someone who knows more
update:2-4-14
well looked like everything compiled last night. even though i forgot to plug the power into a socket x-x
did edit the .dts and added some of the lines from that link, didn't really do anything. i figured it was worth a shot...
update : 2-4-14
looking at my android dmesg i saved
Code:
<6>[ 2.598398] mmc1: new ultra high speed SDR50 SDHC card at address aaaa
<6>[ 2.598778] mmcblk mmc1:aaaa: Card claimed for testing.
<6>[ 2.599158] mmcblk1: mmc1:aaaa SU32G 29.7 GiB
<6>[ 2.602559] mmcblk1: p1 p2
.
.
.
<6>[ 5.456799] mmc2: new ultra high speed SDR104 SDIO card at address 0001
<6>[ 5.457720] SDIO Vendor ID:02d0 and SDIO Device ID: 4324
looks like my sandisk and the wireless are UHS speeds...so...that would explain why neither seem to show up except a 'fail to initialize' error
mmc1 shows as UHS in your log, and I'm pretty sure the driver can handle the drop to 1.8V (IIRC).
On other boards this driver is known to work fine (if a little bit slow), so I really don't know what I screwed up here.
I find it surprising that you are having issues with USB mass storage devices. I really don't see what could go wrong, at least if they are powered externally (i.e. behind a self-powered hub). Could you maybe post the relevant logs?
Gnurou said:
Could you maybe post the relevant logs?
Click to expand...
Click to collapse
here's the dmesg i was talking about
http://pastebin.com/r0uv97Up
as far as linux..there's nothing else to show, nothing shows up. it's like the UHS devices don't exist
IIRC, used tegra defconfig and may have added some crypto/fs' or something...but didn't take anything away. edited the cmdline for boot in .dts
edit:
that linux dmesg was before i put things on internal /data. think it's the same though info though
edit:
http://pastebin.com/agdi1CVR
turned on mmc debug...don't know if this helps. basically keeps looping while the UHS SD card is in.
Mmmm yeah. I'm afraid I'm clueless here, at least until the Tegra MMC driver gets an update. Sorry.
no problem, thanks for taking the time.
quick stupid question...what version of GCC are you using?
$ arm-none-linux-gnueabi-gcc --version
arm-none-linux-gnueabi-gcc (Sourcery CodeBench Lite 2013.05-24) 4.7.3

[Q] Obtaining Volume Labels from Block Devices?

Hey all, I have a quick query based on the following scenario:
My device is an OUYA with XBMC/SPMC installed. Connected to the device is a USB hub and connected to that Hub are two USB Vantec Nexstar dual-bay hard-drive docks. Each dock contains two NTFS formatted drives. My OUYA is rooted and I am using ParagonNTFS to mount the USB devices.
ParagonNTFS mounts the first drive to /sdcard/ParagonNTFS, the second to /sdcard/ParagonNTFS_1 and so forth. The problem is that which drive comes first, second and so forth sometimes changes, probably due to the order in which the OUYA and Linux detect each drive and assign it an entry in /dev/block
I would like to write script or application that mounts the devices using their associated volume label but I am having some trouble locating the tools to extract the volume label. It seems that the standard linux tools for doing so are not included with Android?
Does anyone have any experience or ideas about how I could obtain the volume labels from within a shell script? Ideally I would like to write a shell script that processes everything in /dev/block, determines if it is a volume and mounts it to something like /sdcard/<VOLUMELABEL>

Categories

Resources