LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Mobile
User Name
Password
Linux - Mobile This forum is for the discussion of all topics relating to Mobile Linux. This includes Android, Tizen, Firefox OS, Sailfish OS, Maemo, MeeGo, Ubuntu Mobile, WebOS, Open Mobile Alliance and other similar projects and products.
A reminder that LQ now has a dedicated Android sister site: AndroidQuestions.org

Notices

Reply
 
Search this Thread
Old 12-07-2008, 10:55 AM   #1
lyle_s
Member
 
Registered: Jul 2003
Distribution: Slackware
Posts: 388

Rep: Reputation: 52
Samsung m510 "access beyond end" with 2GB card


When I connect my Samsung m510 with a 2 GB microSD card in it to the USB port and use the phone's menu to "Connect to PC", I get this in /var/log/messages:
Code:
Dec  6 22:15:00 bowman kernel: usb 2-5: new full speed USB device using ohci_hcd and address 3
Dec  6 22:15:00 bowman kernel: usb 2-5: configuration #1 chosen from 1 choice
Dec  6 22:15:00 bowman kernel: scsi7 : SCSI emulation for USB Mass Storage devices
Dec  6 22:15:05 bowman kernel: scsi 7:0:0:0: Direct-Access     Samsung  Mass Storage     2.31 PQ: 0 ANSI: 2
Dec  6 22:15:05 bowman kernel: sd 7:0:0:0: [sdb] 1985025 512-byte hardware sectors (1016 MB)
Dec  6 22:15:05 bowman kernel: sd 7:0:0:0: [sdb] Write Protect is off
Dec  6 22:15:05 bowman kernel: sd 7:0:0:0: [sdb] 1985025 512-byte hardware sectors (1016 MB)
Dec  6 22:15:05 bowman kernel: sd 7:0:0:0: [sdb] Write Protect is off
Dec  6 22:15:05 bowman kernel:  sdb: sdb1
Dec  6 22:15:05 bowman kernel: sd 7:0:0:0: [sdb] Attached SCSI removable disk
Dec  6 22:15:05 bowman kernel: sd 7:0:0:0: Attached scsi generic sg2 type 0
Dec  6 22:15:06 bowman kernel: attempt to access beyond end of device
Dec  6 22:15:06 bowman kernel: sdb: rw=0, want=3967354, limit=1985025
Dec  6 22:15:06 bowman kernel: attempt to access beyond end of device
Dec  6 22:15:06 bowman kernel: sdb: rw=0, want=3967355, limit=1985025
Dec  6 22:15:06 bowman kernel: attempt to access beyond end of device
Dec  6 22:15:06 bowman kernel: sdb: rw=0, want=3967356, limit=1985025
It works fine with a 1 GB microSD card.

df -h says the phone has 2 GB, but for some reason "sd" thinks it's only 1016 MB.

It makes the phone kind of go haywire. If I copy files to the phone they'll show up, but if I try to access them (for example use mplayer to play an mp3) the files aren't really there.

Is this a bug in the kernel? A bug in the phone? Is there a way I can force sd to think it's 2 GB.

Thanks,
Lyle.
 
Old 12-07-2008, 03:30 PM   #2
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Squeeze 2.6.32.9 SMP AMD64
Posts: 3,245

Rep: Reputation: 121Reputation: 121
Quote:
Is there a way I can force sd to think it's 2 GB.
Let me guess; you got this off of ebay, right? There are numerous articles about 1GB devices being remarked and hacked to show that they're 2GB or larger. The directory appears, but the data actually goes into a bit bucket.
 
Old 12-07-2008, 07:45 PM   #3
lyle_s
Member
 
Registered: Jul 2003
Distribution: Slackware
Posts: 388

Original Poster
Rep: Reputation: 52
Quote:
Originally Posted by Quakeboy02 View Post
Let me guess; you got this off of ebay, right? There are numerous articles about 1GB devices being remarked and hacked to show that they're 2GB or larger. The directory appears, but the data actually goes into a bit bucket.
I bought it at a store. It's a SanDisk, but I had the same problem with a Verbatim. I don't think it's the card.

I think it's something to do with how the sd driver determines the size of the card, or how USB reports it, or the phone itself, or some combination thereof.

Lyle.
 
Old 12-07-2008, 08:54 PM   #4
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Squeeze 2.6.32.9 SMP AMD64
Posts: 3,245

Rep: Reputation: 121Reputation: 121
Quote:
Originally Posted by lyle_s View Post
I bought it at a store. It's a SanDisk, but I had the same problem with a Verbatim. I don't think it's the card.

I think it's something to do with how the sd driver determines the size of the card, or how USB reports it, or the phone itself, or some combination thereof.

Lyle.
OK, maybe it's a compatibility problem, then. Good luck!
 
Old 12-08-2008, 12:58 AM   #5
lyle_s
Member
 
Registered: Jul 2003
Distribution: Slackware
Posts: 388

Original Poster
Rep: Reputation: 52
Quote:
Originally Posted by Quakeboy02 View Post
OK, maybe it's a compatibility problem, then. Good luck!
I'll try it with Windows over the holidays (I don't have any Windows machines, but my parents do); maybe that will shed some light on things.

Thanks!

Lyle.
 
Old 12-29-2008, 12:13 AM   #6
lyle_s
Member
 
Registered: Jul 2003
Distribution: Slackware
Posts: 388

Original Poster
Rep: Reputation: 52
Quote:
Originally Posted by lyle_s View Post
I'll try it with Windows over the holidays (I don't have any Windows machines, but my parents do); maybe that will shed some light on things.
It worked like a charm with Windows.

The Windows drivers in use were dated 2001, so I doubt it's one of those situations where Windows is working around bugs/non-standard behavior of the phone.

This is a problem with Linux; how should I proceed to get this fixed?

Lyle.
 
Old 08-02-2010, 08:11 PM   #7
lyle_s
Member
 
Registered: Jul 2003
Distribution: Slackware
Posts: 388

Original Poster
Rep: Reputation: 52
Still no improvement with Slackware 13.1 (kernel 2.6.33.4, libusb-1.0.6).

Here's more detail:

I'm looking at the microSD card I use in the phone. It says 2GB. I put it into the phone, turn it back on.

I press, "Connect to PC" on the phone's menu. I get the following in /var/log/messages:
Code:
Aug  2 17:07:06 bowman kernel: usb 2-5: new full speed USB device using ohci_hcd and address 9
Aug  2 17:07:07 bowman kernel: usb 2-5: New USB device found, idVendor=05c6, idProduct=1000
Aug  2 17:07:07 bowman kernel: usb 2-5: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Aug  2 17:07:07 bowman kernel: usb 2-5: Product: USB MMC Storage
Aug  2 17:07:07 bowman kernel: usb 2-5: Manufacturer: Qualcomm, Incorporated
Aug  2 17:07:07 bowman kernel: usb 2-5: SerialNumber: 000000000002
Aug  2 17:07:07 bowman kernel: scsi9 : usb-storage 2-5:1.0
Aug  2 17:07:12 bowman kernel: scsi 9:0:0:0: Direct-Access     Samsung  Mass Storage     2.31 PQ: 0 ANSI: 2
Aug  2 17:07:12 bowman kernel: sd 9:0:0:0: Attached scsi generic sg4 type 0
Aug  2 17:07:12 bowman kernel: sd 9:0:0:0: [sdc] 1985025 512-byte logical blocks: (1.01 GB/969 MiB)
Aug  2 17:07:12 bowman kernel: sd 9:0:0:0: [sdc] Write Protect is off
Aug  2 17:07:12 bowman kernel:  sdc: sdc1
Aug  2 17:07:12 bowman kernel: sd 9:0:0:0: [sdc] Attached SCSI removable disk
Aug  2 17:07:13 bowman hald: mounted /dev/sdc1 on behalf of uid 1000
The above shows it's only 1GB.
Code:
lyle@bowman:/tmp$ df | egrep 'sdc|File'
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sdc1              1983360   1291744    691616  66% /media/disk
# The above shows it to be 2GB.
Code:
lyle@bowman:/tmp$ echo '1024 * 691616' | bc
708214784
So, according to df, it has 708214784 bytes free.

Here's a file that should fit on the device.
Code:
lyle@bowman:/tmp$ ls -l should_fit 
-rw------- 1 lyle lyle 690000000 2010-08-02 17:22 should_fit
So, I copy it on.
Code:
lyle@bowman:/tmp$ cp should_fit /media/disk/
lyle@bowman:/tmp$ echo $?
0
It copied successfully, although I get reams of messages of the form:
Code:
 	Aug  2 17:27:55 bowman kernel: attempt to access beyond end of device
	Aug  2 17:27:55 bowman kernel: sdc1: rw=1, want=3925911, limit=1984776
in /var/log/messages. But cp did exit without error.

It appears to be there; the device in nearly full as seen below. The phone's UI agrees.
Code:
lyle@bowman:/tmp$ df | egrep 'sdc|File'
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sdc1              1983360   1965600     17760 100% /media/disk
I'll attempt to copy it back off:
Code:
lyle@bowman:/tmp$ cp /media/disk/should_fit should_fit.copy
cp: reading `/media/disk/should_fit': Input/output error
So, it didn't read it back off.
Code:
lyle@bowman:/tmp$ ls -l should_fit.copy 
-rwx------ 1 lyle lyle 36962304 2010-08-02 17:46 should_fit.copy*
So, I get some of it back, but not all. I also get a few more 'attempt to access beyond end of device' in /var/log/messages.

This all works properly with Windows. It fails the same way on another Slackware 13.1 box I have.

In conclusion:
  • There are two subsystems that aren't agreeing about the size of the device.
  • What are these two subsystems?
  • How does each of them determine the size of devices?

Thanks,
Lyle.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Troubleshooting large partition "attempt to access beyond end of device" dear mr. trout Linux - Server 4 10-21-2008 10:02 AM
A single regex to match anything with ".aac" or ".mp3" at the end ? lumix Linux - General 9 05-09-2008 02:11 AM
fdisk reports odd "Start "and "End" sectors on single partition eponymous Linux - Software 3 10-01-2007 04:41 PM
"attempt to access beyond end of device" rcstest Linux - Hardware 0 03-31-2005 04:22 AM
"attempt to access beyond end of device" problem.... AnalyticaL Linux - Hardware 0 10-01-2004 02:16 PM


All times are GMT -5. The time now is 07:09 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration