From owner-freebsd-questions@FreeBSD.ORG Mon May 16 10:59:03 2005 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 16DC916A4CE for ; Mon, 16 May 2005 10:59:03 +0000 (GMT) Received: from rosebud.otenet.gr (rosebud.otenet.gr [195.170.0.26]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3024A43DA7 for ; Mon, 16 May 2005 10:59:02 +0000 (GMT) (envelope-from keramida@FreeBSD.org) Received: from orion.daedalusnetworks.priv (aris.bedc.ondsl.gr [62.103.39.226])j4GAvJv5007685; Mon, 16 May 2005 13:57:20 +0300 Received: from orion.daedalusnetworks.priv (orion [127.0.0.1]) j4GAwuR3001288; Mon, 16 May 2005 13:58:56 +0300 (EEST) (envelope-from keramida@FreeBSD.org) Received: (from keramida@localhost)j4GAwt9E001287; Mon, 16 May 2005 13:58:55 +0300 (EEST) (envelope-from keramida@FreeBSD.org) Date: Mon, 16 May 2005 13:58:55 +0300 From: Giorgos Keramidas To: Steve Message-ID: <20050516105855.GA1223@orion.daedalusnetworks.priv> References: <6.2.1.2.0.20050516005230.0203f110@mail.digitalbluesky.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6.2.1.2.0.20050516005230.0203f110@mail.digitalbluesky.net> cc: freebsd-questions@FreeBSD.org Subject: Re: how to format an external usb drive with a freebsd partititon under freebsd 5.3 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2005 10:59:03 -0000 On 2005-05-16 00:55, Steve wrote: > I've done a google search, read the freebsd handbook and searched the > mailing list archives...maybe I'm not using the right search terms but > I'm not finding the information I need...or I'm misunderstanding > something on a fundamental level. > > I have a 120 gig western digital usb drive with a FAT32 file system > connected to a freebsd 5.3 box that I can mount and read/write to okay > . But (and I think this is correct) when I backup files from my > freebsd 5.3 box to this drive, the file permissions aren't being > maintained. That is because it's a FAT32 files system correct? I've > always in the past backed up linux/freebsd files to other > linux/freebsd boxes so this is the first time I'm dealing with this. > > What is the correct way to format this FAT32 usb drive so I can put > freebsd files on it and maintain the proper owner and file > permissions. I've tried to do this with sysinstall based on the > instructions in the freebsd handbook but I get an error that freebsd > can't write the partition. > > The usb drive is currently mounted, is that the problem? YES, that is a serious problem. You cannot run "newfs" on a mounted partition in FreeBSD. It would mess up the internal state the kernel keeps around for mounted devices (disk & device information, pending I/O buffers, etc). The correct way to switch a disk/partition to UFS is: 1. Mount any partitions the disk has now. 2. Backup the data of the disk somewhere. 3. Unmount ALL the partitions of the disk. 4. Create a BIOS partition (these are called "slices" by FreeBSD) on the disk that covers the area you want to format. 5. Label the slice, creating a BSD partition in it. 6. Run newfs on the new BSD partition. 7. Mount the partition. 8. Restore the data you backed up in step 2. The command line tools that you can use to create & format new BSD partitions are described in the article ``Formatting Media For Use With FreeBSD'', which is available as part of the FreeBSD documentation set: http://www.freebsd.org/doc/en_US.ISO8859-1/articles/formatting-media/ If you read that article and find that it lacks some details or that it confuses you in any way, then it's a bug of the documentation. In that case, feel free to mail me in person or to contact the FreeBSD documentation team (by mailing the freebsd-doc@freebsd.org list). - Giorgos