maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   OS2008 / Maemo 4 / Chinook - Diablo (https://talk.maemo.org/forumdisplay.php?f=29)
-   -   How to get rid of bogus file? (https://talk.maemo.org/showthread.php?t=30360)

pjscott 2009-07-19 04:19

How to get rid of bogus file?
 
Learned the hard way that there's a 4GB file limit. Now I have a directory with a bogus entry. I was copying a 5GB file from another machine, and this is what it looked like there:

% scp In\ the\ Shadow\ of\ the\ Moon\ \(Recorded\ Jul\ 16,\ 2009,\ TDCC\).mpg user@192.168.1.1:/media/mmc1
user@192.168.1.1's password:
In the Shadow of the Moon (Recorded Jul 16, 2 80% 4098MB 744.8KB/s 22:48 ETAFile size limit exceeded
In the Shadow of the Moon (Recorded Jul 16, 2 80% 4098MB 708.7KB/s 23:58 ETAlost connection

This is what it looks like on the Nokia (N810, OS2008):

/media/mmc1 $ ls -l
ls: ./In the Shadow of the Moon (Recorded Jul 16, 2009, TDCC).mpg: Value too large for defined data type

I can't get an inode:

/media/mmc1 $ ls -i
ls: ./In the Shadow of the Moon (Recorded Jul 16, 2009, TDCC).mpg: Value too large for defined data type

Based on the output of df, the file doesn't exist, but its header does. I tried rebooting, no difference. How do I repair this directory? I don't think I can just create another directory and move everything into it, because /media/mmc1 is the mount point for the external card.

Bundyo 2009-07-19 05:22

Re: How to get rid of bogus file?
 
Which file system?

linuxeventually 2009-07-19 07:32

Re: How to get rid of bogus file?
 
It's FAT32 obviously.

I assumed you already tried to remove the file with rm -f (as root)
If this file was saved to the external SD card, did you try putting into a desktop/laptop (Linux) and mounting it?

There might be another way to delete it that is slipping my mind...

Hope you have the files backed up as you might need to format that card's partition.

Bundyo 2009-07-19 07:34

Re: How to get rid of bogus file?
 
fsck in linux/checkdisk in windows?

lma 2009-07-19 09:10

Re: How to get rid of bogus file?
 
Quote:

Originally Posted by pjscott (Post 305356)
Learned the hard way that there's a 4GB file limit.

Interesting... Using dd the maximum size I can produce on a VFAT card is one byte under 2GiB, and the limit seems to be imposed by the kernel: when dd reaches that it receives signal 25 (SIGXFSZ) and dies.

I'm running an scp now but it estimates it's going to take another hour or so...

Quote:

How do I repair this directory?
If rm doesn't work, try

Code:

$ perl -le 'unlink "In the Shadow of the Moon (Recorded Jul 16, 2009, TDCC).mpg";'
If that doesn't work either, you'll probably have to resort to dosfsck. Assuming your card is /dev/mmcblk1p1:

Code:

# umount /dev/mmcblk1p1
# dosfsck -d "In the Shadow of the Moon (Recorded Jul 16, 2009, TDCC).mpg" \
/dev/mmcblk1p1
# dosfsck -a /dev/mmcblk1p1


lma 2009-07-19 09:50

Re: How to get rid of bogus file?
 
1 Attachment(s)
Quote:

Originally Posted by lma (Post 305383)
I'm running an scp now but it estimates it's going to take another hour or so...

It's reached past the 2048MB point now and still going...

Quote:

Originally Posted by pjscott (Post 305356)
/media/mmc1 $ ls -l
ls: ./In the Shadow of the Moon (Recorded Jul 16, 2009, TDCC).mpg: Value too large for defined data type

Looks like a busybox problem (built without LARGEFILE support). The Fremantle version is OK, so it seems pointless to file a bug at this stage :-/

I'm attaching an (earlier) Fremantle busybox binary built on Diablo, just in case it helps you. Do not put it in /bin, just somewhere where it can be executable and use it with an explicit path. For example:

Code:

scp busybox.gz root@<tablet>:
on your PC, and
Code:

# gunzip /root/busybox.gz
# chmod +x /root/busybox
# /root/busybox ls -l /media/mmc1

on the tablet.

lma 2009-07-19 10:16

Re: How to get rid of bogus file?
 
Quote:

Originally Posted by lma (Post 305387)
Looks like a busybox problem (built without LARGEFILE support). The Fremantle version is OK, so it seems pointless to file a bug at this stage :-/

Never mind, that was bug 3917 actually.

lma 2009-07-19 10:37

Re: How to get rid of bogus file?
 
Quote:

Originally Posted by lma (Post 305387)
It's reached past the 2048MB point now and still going...

Terminated at 4294967295 bytes as expected. FYI, the Diablo rm can't delete such a file:

Code:

rm: cannot stat '4gbfile': Value too large for defined data type
but perl worked.

pjscott 2009-07-19 12:47

Re: How to get rid of bogus file?
 
Thanks, that worked! I am embarrassed that I assumed a straight unlink wouldn't work and didn't bother to try perl... since I am the author of three books on Perl :-)


All times are GMT. The time now is 22:33.

vBulletin® Version 3.8.8