From owner-freebsd-questions@FreeBSD.ORG Thu Sep 13 23:42:05 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CA021106566C for ; Thu, 13 Sep 2012 23:42:05 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx02.qsc.de (mx02.qsc.de [213.148.130.14]) by mx1.freebsd.org (Postfix) with ESMTP id 75F548FC12 for ; Thu, 13 Sep 2012 23:42:05 +0000 (UTC) Received: from r56.edvax.de (port-92-195-63-5.dynamic.qsc.de [92.195.63.5]) by mx02.qsc.de (Postfix) with ESMTP id 3AEB42773A; Fri, 14 Sep 2012 01:41:58 +0200 (CEST) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id q8DNfv9T002484; Fri, 14 Sep 2012 01:41:57 +0200 (CEST) (envelope-from freebsd@edvax.de) Date: Fri, 14 Sep 2012 01:41:57 +0200 From: Polytropon To: Gary Kline Message-Id: <20120914014157.38e741cb.freebsd@edvax.de> In-Reply-To: <20120912174625.GA17551@ethic.thought.org> References: <20120911213804.GA9817@ethic.thought.org> <20120912011443.5df17cf2.freebsd@edvax.de> <50502C51.5020601@FreeBSD.org> <20120912174625.GA17551@ethic.thought.org> Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: FreeBSD Mailing List Subject: Re: cksum entire dir?? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Polytropon List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Sep 2012 23:42:05 -0000 On Wed, 12 Sep 2012 10:46:25 -0700, Gary Kline wrote: > On Wed, Sep 12, 2012 at 07:31:45AM +0100, Matthew Seaman wrote: > > On 12/09/2012 00:14, Polytropon wrote: > > > % cksum > > > > > > and could obtain a checksum - so it _seems_ to work. > > > After alteration of one file within the hierarchy a > > > different result was printed. > > > > That will give you a checksum on the directory inode -- file names and > > associated metadata only, not file content. In theory you could edit a > > file without modifying any of the timestamps, and that wouldn't result > > in any change to the directory checksum. Also, modifying things a few > > layers down the filesystem hierarchy won't have any effect either. > > > > Generally I find the best test for differences between old and new > > copies of a filesystem is 'rsync -avx -n ...' > > > > Also, sum and cksum have way too small a key size for this to be > > reliable, since you can't tell a true result from a hash collision. Use > > md5 or sha1 or sha256 for best results. > > > > So this sha256 is *real*?? I have no md5 on my "fedora" > that is on my desktop and m having trouble getting used to. > but the gentleman who recommened cpio was right on the money. > > note that I am loathe to spam this list with the following mail from my > files in sept, 1988, but here it is. if I had only gr -r -w cpio > around in all my directories, I would have found this, sent to one Dirm > Myers across the pond :: > > > === > > From kline Sat Sep 5 11:52:20 1998 > Subject: lost mail file... > To: dirkm@buster.dhis.eu.org (Dirk Myers) > Date: Sat, 5 Sep 1998 11:52:20 -0700 (PDT) > Organization: <> thought.org: public access uNix in service... <> > X-Mailer: ELM [version 2.4ME+ PL32 (25)] > MIME-Version: 1.0 > Content-Type: text/plain; charset=US-ASCII > Content-Transfer-Encoding: 7bit > Content-Length: 2283 > Status: RO > > > Yesterday morning I began composing the next two Q's and A's > in my mailer. Last night in the wee hours there was a power > glitch and I lost the mail. > > Enclosed is the first//next Q/A. I'll send along another one > or two later today. One that I was playing around with *failed* > and I'm trying to figure out why. > > ----- > > How can I uise my FBSD floppy drive to copy files to it (in this case, > at work), and retrieve the files on my FBSD systtem at home. So far > I've only seen examples that used floppies with a filesystem on them. > Is there a simplr, more direct way? > > You can treat the 'raw' floppy device as if it is a tape drive, and > use typically UNIX tape tools to read/write, such as tar and cpio. > For instance, to copy the current directory onto a floppy to > take home at night: > > (put the floppy in the drive, and cd to the directory where > the files are; then ) > > % tar -cvf /dev/rfd0 . > > To read it when you get home: > > (put the floppy in the drive at home; and extract the tarball > wherever you want the files) > > % tar -xvf /dev/rfd0 > > The flags -c and -x indicate create and extract mode, the ``v'' > specifies verbose mode, and the ``f'' tells tar that the following > argument is the file or device that tar acts upon. Here, it is > the floppy devide. > > > With cpio: > > (chdir to the directory where the files are) > > % ls | cpio -oc > /dev/rfd0 > > To read a cpio archive from a tape drive: > > % cpio -icd < /dev/rfd0 > > > The flags -i and -o indicate copy-in or extract mode and > copy-out or create archive mode. The ``c'' tells cpio > to use the old, portablr ASCII archive format. And the > ``d'' flag tells cpio to create directories where necessary. > > Do a > > % man cpio > > for much greater detail on this utility. > > ----- > > There are another one or two of the simpler Q/A's and one or two > more involved. > > Then, for this month only, I want to write a paragraph or two > about who I am and where I'm coming from. Since you are sharing > the by-line you might want to consider this too. > > gary > > PS: Next month we get a break!! > > -- > Gary D. Kline kline@tao.thought.org Public service uNix > > ==== > as you can see, this dealt with my olden tape drive. a 250meg > QIC drive, I think. Really? I think /dev/rfd0 refers to fd - floppy disk. Even though I know there are floppy-controller connected tape drives (still have one myself!), the examples shown seem to indicate work with a floppy disk, used in a "non-fs'ed" manner, just as I did in the past with "tar, the most universal file system that isn't even a filesystem" to transfer files across different UNIX / BSD / Linux boxes via floppy (because they've not been networked). Still the examples look fully valid when applied to a tape drive, as both floppy and tape can be (ab)used as "linear fs-less media". :-) > but this was about the earliest reference > I could find re my use of cpio. there are others in my journal > dir that reference my running out of hard drive and using cpio rather > that a straight cp -rp. I've been using cpio as a means of backup in combination with a "chain" of 650 MB CD-R's. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...