Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: cp(1) from ntfs fails



Jukka Salmi --> current-users (2008-04-24 20:25:43 +0200):
> Hello,
> 
> trying to copy files from a ntfs (win xp) file system using cp(1) on
> a 4.99.60 i386 system currently fails (IIRC this used to work):
> 
> $ mount
> [...]
> /dev/wd0n on /mnt/win type ntfs (read-only, local)
> 
> $ ls -l /mnt/win/BOOT.INI
> -rwxr-xr-x  1 root  wheel  194 Sep 18  2006 /mnt/win/BOOT.INI
> 
> $ cp /mnt/win/BOOT.INI .
> cp: ./BOOT.INI: Invalid argument
> 
> 
> Tracing cp(1) shows:
> 
> [...]
>    615      1 cp       CALL  open(0xbb907c00,0,0)
>    615      1 cp       NAMI  "/mnt/win/BOOT.INI"
>    615      1 cp       RET   open 3
>    615      1 cp       CALL  open(0x804b208,0x601,0x81ed)
>    615      1 cp       NAMI  "./BOOT.INI"
>    615      1 cp       RET   open 4
>    615      1 cp       CALL  mmap(0,0xc2,1,1,3,0,0,0)
>    615      1 cp       RET   mmap -1146105856/0xbbafd000
>    615      1 cp       CALL  madvise(0xbbafd000,0xc2,2)
>    615      1 cp       RET   madvise 0
>    615      1 cp       CALL  write(4,0xbbafd000,0xc2)
>    615      1 cp       RET   write -1 errno 22 Invalid argument
> [...]
> 
> Hmm, why could the write be failing?

BTW, copying files larger than 8 MB seems to work fine; cp(1) doesn't
use mmap(2) in this case. Furthermore, reading files also works fine,
so I can use e.g. tar(1) as a workaround to copy files.

And, cmp(1) even dumps core if one of the files to be compared is on
the ntfs:

$ cmp /bin/ls /mnt/win/BOOT.INI
Segmentation fault (core dumped)

$ gdb cmp cmp.core 
GNU gdb 6.5
[...]
Core was generated by `cmp'.
Program terminated with signal 11, Segmentation fault.
#0  0x0804913c in c_regular ()
(gdb) bt
#0  0x0804913c in c_regular ()
#1  0x08048da3 in main ()
(gdb) quit

Seems to be somehow mmap(2) related... Anybody able to reproduce this?


Regards, jukka

-- 
bashian roulette:
$ ((RANDOM%6)) || rm -rf ~


Home | Main Index | Thread Index | Old Index