LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-17-2021, 09:29 PM   #1
ordealbyfire83
Member
 
Registered: Oct 2006
Location: Leiden, Netherlands
Distribution: LFS, Ubuntu Hardy
Posts: 302

Rep: Reputation: 89
Something trying to access beyond end of FAT partition


I have a USB GPS with internal flash memory formatted as FAT-16 used for storing logs. But when I try to retrieve the logs, I cannot actually open the files properly. Pluma complains that it cannot detect the encoding. Vim opens the file just fine but the last ~10% of the file or so is gibberish.

dmesg | tail shows
Code:
[496127.507796] sdb1: rw=0, want=15329, limit=15312
[496127.507801] Buffer I/O error on dev sdb1, logical block 15328, async page read
[496127.507805] attempt to access beyond end of device
[496127.507810] sdb1: rw=0, want=15332, limit=15312
[496127.507815] Buffer I/O error on dev sdb1, logical block 15331, async page read
[496127.507819] attempt to access beyond end of device
[496127.507824] sdb1: rw=0, want=15333, limit=15312
[496127.507828] Buffer I/O error on dev sdb1, logical block 15332, async page read
[496127.507909] attempt to access beyond end of device
[496127.507915] sdb1: rw=0, want=15418, limit=15312
And fdisk shows this:
Quote:
Disk /dev/sdb: 7.5 MiB, 7839744 bytes, 15312 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00000000

Device Boot Start End Sectors Size Id Type
/dev/sdb1 63 15311 15249 7.5M 4 FAT16 <32M
It looks to me like the partition fits where it should, so where is the problem? Does the GPS in firmware think it has more storage than it does? These log files are only several hundred KB's with a few MB's free, so I'm not even close to being full. Any ideas?
 
Old 06-18-2021, 12:52 AM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,356

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
This
Code:
Max. volume size	FAT12: 32 MB (256 MB for 64 KB clusters) 
                        FAT16: 2 GB (4 GB for 64 KB clusters) 
                        FAT32: 2 TB (16 TB for 4 KB sectors)
?
 
Old 06-18-2021, 01:20 AM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,120

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
That error often means the filesystem is larger than the partition . What does "df -hT" show.
 
Old 06-18-2021, 10:06 AM   #4
ordealbyfire83
Member
 
Registered: Oct 2006
Location: Leiden, Netherlands
Distribution: LFS, Ubuntu Hardy
Posts: 302

Original Poster
Rep: Reputation: 89
I just copied something into here as a test, so it's almost full now. df -hT gives

Code:
/dev/sdb1         vfat      7.8M  7.4M  451K  95% /media/gps
But there's also this:
Code:
<username>@<hostname>:~$ sudo fsck.vfat -vVn /dev/sdb1
[sudo] password for <username>: 
fsck.fat 3.0.28 (2015-05-16)
Checking we can access the last sector of the filesystem
Seek to 8355328:Invalid argument
Not sure what to make of it.
 
Old 06-18-2021, 07:53 PM   #5
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,342

Rep: Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484
Quite simply, I would verify the flash is actually 8 MB as shown by fdisk.
Then I would backup the data on it, reformat it, then put whatever is needed back on.

It looks like the fat table has gotten corrupted so the drive was written to by a file too large to fit and the fat table did not catch the actual end of the device. Or the weaknesses of the fat table have struck where the file structure is not properly followed due to severe fragmentation.
 
Old 06-18-2021, 10:04 PM   #6
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,974

Rep: Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623
I agree with the others for ideas.

Guess a damaged flash or issue with controller could also be to blame.

sudo dosfsck -w -r -l -a -v -t /dev/sdc1

https://askubuntu.com/questions/1472...32-file-system
 
Old 06-21-2021, 10:45 PM   #7
ordealbyfire83
Member
 
Registered: Oct 2006
Location: Leiden, Netherlands
Distribution: LFS, Ubuntu Hardy
Posts: 302

Original Poster
Rep: Reputation: 89
I opted to make a 'dd' back up of the partition and reformat. I'm not too sure about using mkfs.vfat for small fat16 partitions (fdisk type 4) as it seems there are some bugs. So I formatted in a Windows 2000 VM. Once I powered on the GPS, it started regenerating all sorts of log files even from before I bought it (it was used). Fortunately, I was able to get a new copy of my last corrupted log file.

It seems there is another (hidden) partition where the raw data is stored. The manual gives no indication of how to clear it, as now it claims that the free space has dropped rapidly since recreating the FAT partition. I thought before that this indicator referred to the FAT partition, but clearly not. I filed a ticket with the manufacturer for support but have yet to get a reply.
 
Old 06-22-2021, 10:44 AM   #8
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,642
Blog Entries: 4

Rep: Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933
I'd say that either the filesystem is larger than the partition, or there's an error somewhere in the FAT ... something that contains a disk location which does not exist. fsck should be your first diagnostic step.
 
Old 06-29-2021, 10:36 PM   #9
ordealbyfire83
Member
 
Registered: Oct 2006
Location: Leiden, Netherlands
Distribution: LFS, Ubuntu Hardy
Posts: 302

Original Poster
Rep: Reputation: 89
Turns out this device keeps its logs cached forever more in a separate, hidden partition that isn't accessible over the USB cable. And as you use it more, the cache fills up. Apparently you can only clear this cache using the manufacturer's iOS app - and you're totally out of luck if you don't have the latest model i-gadget. It's no wonder I got this so cheap, as the previous owner claimed to be "totally fed up" with it.

Anyone else with a Bad Elf Pro+ have any success on clearing this by some other means?

Just an aside, this GPS is not the least bit transparent on how it calculates its accuracy measurements. Likewise the NMEA sequences alternate between GPS and GLONASS rather than putting them together, as does the Garmin GLO. So if you use gpsd + xgps you will have difficulty maintaining a fix, but you will be able to get a more clear picture of what kind of accuracy you're getting. If you take 30 elevation readings from a Garmin GLO at random times over a week from the same location and plot them with error bars and calculate a weighted average, the average reading (with error bar) will pass through almost all of the other readings, with only a couple outliers. In contrast, practically everything with the Bad Elf is an outlier. Yet the weighted averages are very close to that measured by the Garmin GLO. That likely shows that Bad Elf seriously overstates their accuracy claims.
 
  


Reply



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
Something depends on something else but something else is to be installed javascriptninja Linux - Newbie 3 02-05-2012 04:22 PM
Troubleshooting large partition "attempt to access beyond end of device" dear mr. trout Linux - Server 4 10-21-2008 09:02 AM
"attempt to access beyond end of device" problem.... AnalyticaL Linux - Hardware 0 10-01-2004 01:16 PM
log: attempt to access beyond end of device 360 Linux - General 1 09-18-2003 07:52 PM
Attempting to access beyond end of device? MasterC Linux - Hardware 13 01-29-2003 05:57 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:15 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
Open Source Consulting | Domain Registration