From owner-freebsd-questions@FreeBSD.ORG Mon Nov 7 07:54:02 2011 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5EB261065679 for ; Mon, 7 Nov 2011 07:54:02 +0000 (UTC) (envelope-from smithi@nimnet.asn.au) Received: from sola.nimnet.asn.au (paqi.nimnet.asn.au [115.70.110.159]) by mx1.freebsd.org (Postfix) with ESMTP id A3AB88FC13 for ; Mon, 7 Nov 2011 07:54:01 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by sola.nimnet.asn.au (8.14.2/8.14.2) with ESMTP id pA77rwRO056370; Mon, 7 Nov 2011 18:53:58 +1100 (EST) (envelope-from smithi@nimnet.asn.au) Date: Mon, 7 Nov 2011 18:53:58 +1100 (EST) From: Ian Smith To: Chris In-Reply-To: <20111105225546.91B0C1065764@hub.freebsd.org> Message-ID: <20111107180715.U72449@sola.nimnet.asn.au> References: <20111105225546.91B0C1065764@hub.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: Michael Sierchio , freebsd-questions@freebsd.org Subject: Re: recursive copy with spaces in descendants X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2011 07:54:02 -0000 In freebsd-questions Digest, Vol 387, Issue 10, Message: 34 On Sat, 5 Nov 2011 18:49:29 -0400 Chris wrote: > On Sat, Nov 5, 2011 at 6:20 PM, Michael Sierchio wrote: > > On Sat, Nov 5, 2011 at 3:15 PM, Chris wrote: > >> I apologize for the lack of detail. The command I'm using is: > >> ( cd /usr/local/etc/transmission/home/Downloads/ ; tar cf - . ) | ( cd > >> /mnt/usb ; tar xf - ) > > > > Show, don't tell. What does tar report when you run it? Indeed this helps, especially now we also know it's msdosfs .. > The following messages display: > > ./: Can't set user=921/group=921 for . > ./Reboot S1 - 01 [3FD6C4B2].mkv: Can't create 'Reboot S1 - 01 [3FD6C4B2].mkv' > > The last message (can't create) repeats for all files in the > directory. Running 'ls -al /mnt/usb' yields: > > drwxr-xr-x 1 root wheel 32768 Dec 31 1979 . > drwxr-xr-x 1 root wheel 512 Nov 5 03:04 .. > > Where /mnt/usb was originally empty in the first place. Something I've seen noone mention is that msdosfs has no concept of user or group, so "Can't set user=921/group=921 for ." makes perfect sense. Your 'ls -al' above showing "root wheel" indicates permissions related to the mount point. If you'd mounted it as a normal user it could show "user user" ownerships, unrelated to what msdosfs stores on the disk. Similarly, mount_msdosfs(8) -u, -g and -m switches don't affect what's written to the disk, but only how the filesystem appears to FreeBSD. For example, a 'cp -pR /etc /mnt/usb" also complains about not being able to set the ownership or permissions (other than DOS' read-only attribute) on target files, but it will still copy them ok, including filenames with spaces - but not with '&,+' or other non-DOS characters. So maybe tar gives up before writing, because the ownership is wrong? Perhaps the -o and -p options to tar(1) might help here, but the bottom line is that msdosfs is not really a suitable target for UFS files. I tend to use zip(1) - which keeps perms and ownership, though not hard links - to stash dirs and files on msdosfs, but format flash disks - or at least one or more slices on them - as UFS for real backup purposes. cheers, Ian