From owner-freebsd-fs@FreeBSD.ORG Sat Jun 9 11:45:28 2012 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB84E106566B for ; Sat, 9 Jun 2012 11:45:28 +0000 (UTC) (envelope-from se@freebsd.org) Received: from nm12.bullet.mail.ird.yahoo.com (nm12.bullet.mail.ird.yahoo.com [77.238.189.65]) by mx1.freebsd.org (Postfix) with SMTP id EEF288FC08 for ; Sat, 9 Jun 2012 11:45:27 +0000 (UTC) Received: from [77.238.189.48] by nm12.bullet.mail.ird.yahoo.com with NNFMP; 09 Jun 2012 11:45:26 -0000 Received: from [217.146.189.108] by tm1.bullet.mail.ird.yahoo.com with NNFMP; 09 Jun 2012 11:45:26 -0000 Received: from [127.0.0.1] by smtp124.mail.ird.yahoo.com with NNFMP; 09 Jun 2012 11:45:26 -0000 X-Yahoo-Newman-Id: 713434.37796.bm@smtp124.mail.ird.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: l5OunHIVM1lcsdXSPHCoZmVkjy1IAtp6B5khM17T.u17HzS b1aeb2MwCFNZTHptvmfIGmyvf.HBBLgJT0ywOg5jgz31p32giAU0TiBgJ8oO a1Lwit0GrQjWzICik3UzXn4y9IF30DakiRbva.ACtBiWCraNcHneQbwhI0Ze 1bnaCUur2aI52kbLY7sBhTscZLw5AAiHqDjfhBPmTCA4sPjs177V_NiQ7hgo nVhLVJTFHDukQoX3UJNeqs1L_MVOY44PJ9Z3P2Y520bhzW1qcE4XVAq2YjHc whqi8ys08jPDY1lgwcp0gAoQefcdSpz4DkHPx27CjtK4Ta7yFfsA.DRt8t0Q yW0zeYEoi9UwWGDoLWjdlgcJWV9tAaJbs4WkMPPfifZ5ykoL2X2hTzUBzicD E X-Yahoo-SMTP: iDf2N9.swBDAhYEh7VHfpgq0lnq. Received: from [192.168.119.11] (se@81.173.147.13 with plain) by smtp124.mail.ird.yahoo.com with SMTP; 09 Jun 2012 04:45:26 -0700 PDT Message-ID: <4FD33754.9080905@freebsd.org> Date: Sat, 09 Jun 2012 13:45:24 +0200 From: Stefan Esser User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20120604 Thunderbird/13.0 MIME-Version: 1.0 To: Rafael Henrique Faria References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-fs@freebsd.org Subject: Re: UFS2 space usage X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2012 11:45:28 -0000 Am 06.06.2012 16:32, schrieb Rafael Henrique Faria: > Hi. > > I'm transferring a disk from my MacBook to my FreeBSD server, it's a 500GB > 3,5" disk in an USB enclosure. > As I was using it in MacOS, it was formated with HFS+. So I transfered all > data from it to an second disk. > Then I reformatted the disk inside the FreeBSD 9.0, using GPT, and using > all disk (with HFS+ there was a EFI partition, plus a free space in the > beginning and in the end of the disk). > I used this options for newfs: "-U2 -o space". > > The 500GB disk in HFS+, was with 2GB free, so 498GB in use. (Apple, uses 1 > K as 1000 Bytes, and 1 M as 1000 K, so you really see 500GB of free space > and occupied). > > After trying to move the data back to the 500GB disk formated in UFS2, 44GB > couldn't be transferred. There is no free space for all the data. > > In FreeBSD it says that the disk have 458GB, and is using 415GB, and have > 6.2GB free. But I still have 48GB of data to transfer to it. > > Is HFS+ more optimized to store files then UFS2? There is something that I > can do to get more space for data? 1. What is the average file size? With small files, you should adjust the block size (possibly down to 4096/512) and may want to use UFS1 (smaller inode). With large files, you should specify the average file size in bytes as newfs option (-i). The block and fragment size is set with the -b and -f options of newfs and the fragment size must be a power of 2 larger than the sector size, while the block size is 8 times the fragment size for best results. 2. You probably do not want to use "-o space". Optimizing for Space hardly any effect for large files, since it only affects the allocation of fragments (and those are only relevant for files with less than 13 blocks). Since the file system switches from "-o time" to "-o space" when it fills, you probably do not want to override this setting. 3. You may want to reduce the reserved space down from 8%. Depending on your planned use of this disk, a lower reservation may or may not be acceptable. The higher the amount of free blocks, the better the allocation of blocks for a newly written file. If you do not plan to write many large files when the disk is nearly full, then you may adjust this value down without adverse effects. Regards, STefan