Bug 74233 - ntfsclone (sysutils/ntfsprogs) broken
Summary: ntfsclone (sysutils/ntfsprogs) broken
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-22 11:00 UTC by Geoff Buckingham
Modified: 2005-03-21 13:16 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Geoff Buckingham 2004-11-22 11:00:46 UTC
      
ntfsclone of /usr/ports/sysutils/ntfsprogs is broken, claims ntfs partitions do not have a valid ntfs file system:

RELENG5# truss ntfsclone -o /other/tsestclone.img /dev/da0s1
mmap(0x0,3880,(0x3)PROT_READ|PROT_WRITE,(0x1000)MAP_ANON,-1,0x0) = 671559680 (0x28073000)
munmap(0x28073000,0xf28)                         = 0 (0x0)
__sysctl(0xbfbfe8ec,0x2,0x2806fa4c,0xbfbfe8e8,0x0,0x0) = 0 (0x0)
mmap(0x0,32768,(0x3)PROT_READ|PROT_WRITE,(0x1002)MAP_ANON|MAP_PRIVATE,-1,0x0) = 671559680 (0x28073000)
issetugid()                                      = 0 (0x0)
open("/etc/libmap.conf",0x0,0666)                ERR#2 'No such file or directory'
access("/usr/local/lib/libntfs.so.5",0)          = 0 (0x0)
open("/usr/local/lib/libntfs.so.5",0x0,027757765004) = 3 (0x3)
fstat(3,0xbfbfe9e4)                              = 0 (0x0)
read(0x3,0x2806e9a0,0x1000)                      = 4096 (0x1000)
mmap(0x0,81920,(0x5)PROT_READ|PROT_EXEC,(0x20002)MAP_NOCORE|MAP_PRIVATE,3,0x0) = 671592448 (0x2807b000)
mprotect(0x2808d000,4096,(0x7)PROT_READ|PROT_WRITE|PROT_EXEC) = 0 (0x0)
mprotect(0x2808d000,4096,(0x5)PROT_READ|PROT_EXEC) = 0 (0x0)
mmap(0x2808e000,4096,(0x3)PROT_READ|PROT_WRITE,(0x12)MAP_FIXED|MAP_PRIVATE,3,0x12000) = 671670272 (0x2808e000)
close(3)                                         = 0 (0x0)
access("/usr/local/lib/libc.so.5",0)             ERR#2 'No such file or directory'
open("/var/run/ld-elf.so.hints",0x0,05001561730) = 3 (0x3)
read(0x3,0xbfbfe994,0x80)                        = 128 (0x80)
lseek(3,0x80,SEEK_SET)                           = 128 (0x80)
read(0x3,0x28078000,0x56)                        = 86 (0x56)
close(3)                                         = 0 (0x0)
access("/lib/libc.so.5",0)                       = 0 (0x0)
open("/lib/libc.so.5",0x0,027757765004)          = 3 (0x3)
fstat(3,0xbfbfe9e4)                              = 0 (0x0)
read(0x3,0x2806e9a0,0x1000)                      = 4096 (0x1000)
mmap(0x0,888832,(0x5)PROT_READ|PROT_EXEC,(0x20002)MAP_NOCORE|MAP_PRIVATE,3,0x0) = 671674368 (0x2808f000)
mprotect(0x2814e000,4096,(0x7)PROT_READ|PROT_WRITE|PROT_EXEC) = 0 (0x0)
mprotect(0x2814e000,4096,(0x5)PROT_READ|PROT_EXEC) = 0 (0x0)
mmap(0x2814f000,20480,(0x3)PROT_READ|PROT_WRITE,(0x12)MAP_FIXED|MAP_PRIVATE,3,0xc0000) = 672460800 (0x2814f000)
mmap(0x28154000,81920,(0x3)PROT_READ|PROT_WRITE,(0x1012)MAP_ANON|MAP_FIXED|MAP_PRIVATE,-1,0x0) = 672481280 (0x28154000)
close(3)                                         = 0 (0x0)
access("/lib/libc.so.5",0)                       = 0 (0x0)
mmap(0x0,584,(0x3)PROT_READ|PROT_WRITE,(0x1000)MAP_ANON,-1,0x0) = 672563200 (0x28168000)
munmap(0x28168000,0x248)                         = 0 (0x0)
mmap(0x0,1288,(0x3)PROT_READ|PROT_WRITE,(0x1000)MAP_ANON,-1,0x0) = 672563200 (0x28168000)
munmap(0x28168000,0x508)                         = 0 (0x0)
mprotect(0x2808f000,786432,(0x7)PROT_READ|PROT_WRITE|PROT_EXEC) = 0 (0x0)
mmap(0x0,22000,(0x3)PROT_READ|PROT_WRITE,(0x1000)MAP_ANON,-1,0x0) = 672563200 (0x28168000)
munmap(0x28168000,0x55f0)                        = 0 (0x0)
mprotect(0x2808f000,786432,(0x5)PROT_READ|PROT_EXEC) = 0 (0x0)
sigaction(SIGILL,{ 0x28057960 0x0|ONSTACK|RESTART|RESETHAND|NOCLDSTOP|NODEFER|NOCLDWAIT|SIGINFO ss_t },{ SIG_DFL 0x0|ONSTACK|RESETHAND|NOCLDSTOP|NODEFER|NOCLDWAIT ss_t }) = 0 (0x0)
sigprocmask(0x1,0x0,0x2806e8fc)                  = 0 (0x0)
sigaction(SIGILL,{ SIG_DFL 0x0|ONSTACK|RESETHAND|NOCLDSTOP|NODEFER|NOCLDWAIT ss_t },0x0) = 0 (0x0)
sysarch(0x1,0xbfbfea44)                          = 17 (0x11)
sigprocmask(0x1,0x2806e8a0,0xbfbfea44)           = 0 (0x0)
sigprocmask(0x3,0x2806e8b0,0x0)                  = 0 (0x0)
ntfsclone v1.9.2
write(2,0xbfbfe320,17)                           = 17 (0x11)
stat("/other/tsestclone.img",0xbfbfe9f0)         ERR#2 'No such file or directory'
open("/dev/null",0x0,0666)                       = 3 (0x3)
readlink("/etc/malloc.conf",0xbfbfe930,63)       ERR#2 'No such file or directory'
issetugid()                                      = 0 (0x0)
mmap(0x0,4096,(0x3)PROT_READ|PROT_WRITE,(0x1002)MAP_ANON|MAP_PRIVATE,-1,0x0) = 672563200 (0x28168000)
break(0x8051000)                                 = 0 (0x0)
break(0x8052000)                                 = 0 (0x0)
break(0x8053000)                                 = 0 (0x0)
break(0x8054000)                                 = 0 (0x0)
open("/dev/da0s1",0x0,01001230000)               = 4 (0x4)
fcntl(4,F_SETLK,0xbfbfe8e0)                      ERR#22 'Invalid argument'
close(4)                                         = 0 (0x0)
fstat(1,0xbfbfe690)                              = 0 (0x0)
ioctl(1,TIOCGETA,0xbfbfe6d0)                     = 0 (0x0)
ERROR(22): ntfs_mount failed: Invalid argument
write(1,0x8052000,47)                            = 47 (0x2f)
Apparently device '/dev/da0s1' doesn't have a valid NTFS. Maybe you selected
write(1,0x8052000,77)                            = 77 (0x4d)
the whole disk instead of a partition (e.g. /dev/hda, not /dev/hda1)?
write(1,0x8052000,70)                            = 70 (0x46)
exit(0x1)
process exit, rval = 256

just to demonstate the vality of /dev/da0s1 as an ntfs partition:

RELENG5# fdisk da0
******* Working on device /dev/da0 *******
parameters extracted from in-core disklabel are:
cylinders=1174 heads=255 sectors/track=63 (16065 blks/cyl)

Figures below won't work with BIOS for partitions not in cyl 1
parameters to be used for BIOS calculations are:
cylinders=1174 heads=255 sectors/track=63 (16065 blks/cyl)

Media sector size is 512
Warning: BIOS sector numbering starts with sector 1
Information from DOS bootblock is:
The data for partition 1 is:
sysid 7 (0x07),(OS/2 HPFS, NTFS, QNX-2 (16 bit) or Advanced UNIX)
    start 63, size 16193457 (7906 Meg), flag 80 (active)
        beg: cyl 0/ head 1/ sector 1;
        end: cyl 1007/ head 254/ sector 63
The data for partition 2 is:
sysid 7 (0x07),(OS/2 HPFS, NTFS, QNX-2 (16 bit) or Advanced UNIX)
    start 16193520, size 2666790 (1302 Meg), flag 0
        beg: cyl 1008/ head 0/ sector 1;
        end: cyl 1023/ head 254/ sector 63
The data for partition 3 is:
<UNUSED>
The data for partition 4 is:
<UNUSED>
RELENG5# mount -t ntfs /dev/da0s1 /mnt
RELENG5# ls /mnt
$AttrDef                        BOOT.INI                        System Volume Information
$BadClus                        BOOTLOG.TXT                     TEMP
$Bitmap                         BOOTSECT.DOS                    WINNT
$Boot                           BUILD.VER                       autoexec.bat
$Extend                         COMMAND.COM                     cmdcons
$LogFile                        CONFIG.SYS                      cmldr
$MFTMirr                        DRIVERS                         final.bat
$Secure                         Documents and Settings          ntldr
$UpCase                         IO.SYS                          pagefile.sys
$Volume                         MSDOS.SYS                       reuters
$WINNT.LOG                      NTDETECT.COM                    util
BOOT.BAK                        Program Files                   wmpub

How-To-Repeat:       see above:
Comment 1 Volker Stolz freebsd_committer freebsd_triage 2004-11-23 14:45:23 UTC
State Changed
From-To: open->feedback

This is most probably an application bug. 
Please contact the upstream author or the maintainer.
Comment 2 Geoff Buckingham 2004-11-24 08:59:05 UTC
The application attempts to lock the device special file (here
/dev/da0s1) with fcntl, this obviously works in Linux, and the netbsd
pkg_src patches don't change that behaviour, so I assume it also works
there.

Should  fcntl work here? I have had a quick look and some the base OS
tools and can't find an example of its use in this context.


-------------------------------------------------------------- --
        Visit our Internet site at http://www.reuters.com

Get closer to the financial markets with Reuters Messaging - for more
information and to register, visit http://www.reuters.com/messaging

Any views expressed in this message are those of  the  individual
sender,  except  where  the sender specifically states them to be
the views of Reuters Ltd.
Comment 3 Florent Thoumie 2005-02-20 17:04:51 UTC
Sorry I must have answer this PR sooner but I wasn't CC'ed,
thanks portsmon.

I'm not able to test this anymore, but I just sent ntfsprogs
update. I hope this will solve your problem. If it doesn't
and you're not able to come with a patch to fix this,
please send an email to the Linux-NTFS project developers or
contact them via IRC, they have been very responsive last time
I tried to contact them.
Comment 4 Florent Thoumie freebsd_committer freebsd_triage 2005-03-21 13:16:32 UTC
State Changed
From-To: feedback->closed

A patch has been committed, thank you for your report!