From owner-freebsd-questions Sat Jan 12 1:45:44 2002 Delivered-To: freebsd-questions@freebsd.org Received: from guru.mired.org (okc-65-31-201-166.mmcable.com [65.31.201.166]) by hub.freebsd.org (Postfix) with SMTP id 5400C37B400 for ; Sat, 12 Jan 2002 01:45:38 -0800 (PST) Received: (qmail 54576 invoked by uid 100); 12 Jan 2002 09:45:37 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15424.1472.594718.233277@guru.mired.org> Date: Sat, 12 Jan 2002 03:45:36 -0600 To: Paul Murphy , Brian T.Schellenberger Cc: questions@freebsd.org Subject: Re: Filesystem Full (was (No Subject)) In-Reply-To: <106655512@toto.iv> X-Mailer: VM 6.90 under 21.1 (patch 14) "Cuyahoga Valley" XEmacs Lucid X-face: "5Mnwy%?j>IIV\)A=):rjWL~NB2aH[}Yq8Z=u~vJ`"(,&SiLvbbz2W`;h9L,Yg`+vb1>RG% *h+%X^n0EZd>TM8_IB;a8F?(Fb"lw'IgCoyM.[Lg#r\ From: "Mike Meyer" X-Delivery-Agent: TMDA/0.43 (Python 2.2; freebsd-4.4-STABLE-i386) Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Paul Murphy wrote: > /dev/da1s1f 663553 2764 607705 0% /usr/home > /dev/da1s1e 192543 183627 -6487 104% /usr/ports > > I want to switch these two filesystems, here is my plan: > > 1) back them up to /usr/tmp > 2) rm -r /usr/home && rm -r /usr/ports > 3) edit the fstab appropriately > 4) umount /usr/home && umount /usr/ports > 5) mount /usr/home && mount /usr/ports > 6) cp -r /usr/tmp/home/* /usr/home && cp -r /usr/tmp/ports/* /usr/ports This one is a bad idea, so I hope you haven't tried it yet. > Does this seem right? Any gotcha's? I don't want to loose any data as > these are fairly important filesystems (although I could cvsup ports). Yup. cp copies hard link as separate files. If you have any, you'll wind up taking up more space after the copy is over than you did before. Among other possible problems. I recommend: 1) dump them to /usr/tmp. Dump handles everything correctly. 2) Step 4 from above 3) newfs /dev/da1s1f and /dev/da1s1e, as that should be faster than rm. 4) edit the fstab. 5) step 5 from above 6) restore the dumped file systems. Brian T.Schellenberger types: > > 6) cp -r /usr/tmp/home/* /usr/home && cp -r /usr/tmp/ports/* /usr/ports > Again, mv is easier & preserves all the file attributes; if you don't use mv > for some reason (extra paranoia?), use pax -rw or cp -pr or a tar-pipe to > preserve all the file attributes. If you're mv'ing things to a different file system, it invoke cp to do the mv. See the man page for details. This means it inherits the problem with hard links. mv does things right if you're on the same file system. pax and tar should work properly, but - well, dump was designed for dealing with this kind of thing. If you're tight for space, you can even send the dumped data to stdout and gzip or bzip2 it before putting it on disk. http://www.mired.org/home/mwm/ Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message