这里讲的是个人使用问题,大牛们有空帮忙改改。
事情的起因是这样,给Ubuntu 9.04增加了个80GB的硬盘,用gparted分区格式化,因为观念中一直有个reiserfs的影子,所以没怎么考虑就选了reiserfs,把整个硬盘格式化成一个区。加载到挂载点上(warehouse),修改/etc/fstab。可以正常使用了,随便拷点东西,3GB,还不错。
然后,突发奇想,放狗一搜,看到这篇:
Linux各种文件系统(ext3,ReiserFS,jfs,xfs)的性能
感谢翻译。
动摇,从名字上就能看出,当仓库用的地方,万一有个好歹的,岂止是肠子悔青,于是马上格成ext3。
但,我还什么都没干,80GB的硬盘就被占用了4GB的空间,一部720p啊。
一边等回帖一边继续放狗。
除了搜到上面那篇的原文外(06年的,确实老了。),还得到这篇,觉得对个人用户比较有意义,转过来。题外话,ubuntu的fstab里面用UUID来指定挂载的磁盘,UUID就是磁盘的编号(反正我这么理解的),那么如何查看UUID捏?其实在*nix系统里面,分区好像没什么实际意义,“区”这个名称,只是用来沿袭来自windows的使用习惯而已。代码: 全选
ls -l /dev/disk/by-uuid
which to use: ext3, JFS, XFS, ReiserFS?
全文如下:翻译烂,将就看。
后面还有个挺有价值的回帖which to use: ext3, JFS, XFS, ReiserFS?
* From: Hugo Vanwoerkom <hvw59601@xxxxxxxxx>
* Date: Sat, 19 Jan 2008 09:17:54 -0600
Douglas A. Tutty wrote:
On Fri, Jan 18, 2008 at 04:11:17PM -0500, Jimmy Wu wrote:
I am trying to decide on which file systems to use for a Debian
install on a personal laptop. It's a Thinkpad T61 with one 160 GB HD.
I've looked around on Google, and come up with a lot of frustratingly
conflicting advice. For example, an article from
debian-administration touts XFS as the best in performance. But other
sites mention that XFS may be more vulnerable to corruption on a
crash/power outage than the other file systems. Then, people disagree
on the performance of ext3 vs ReiserFS.
Part of the confusion is the "religious" nature of the issue, part is
the changing nature and experience of the filesystems in question.
Here's a summary (sorry, no references):
对于这个问题的举棋不定,一部分是因为对于文件系统有虔诚的宗教信仰般的情结,一部分是来自改变“信仰”以及实际使用而带来的疑惑所致,下面小结一下:
ext2 = long-time default linux fs. bugs have been worked out. Inspired
by UNIX ffs (fast filesystem) with decades of history. Note that
decades ago, drives were puny compared to today.
ext2 使用了相当长时间的linux默认磁盘格式,bug已经修补了一堆。它由UNIX文件格式ffs(fast filesystem)演化而来,至今已有20年历史。请注意,20年前的硬件驱动程序跟今天的比起来只是小巫见大巫。
ext3 = ext2 + metadata(default) journaling. Therefore slower than ext2.
exit3 ext2+日志系统(metadata),于是比ext2慢。
Reiserfs = designed by one person who has had some kind of problems (I
haven't looked into it). If damage occurs (e.g. unclean shutdown), may
not be able to fix the damage and loses data.
Reiserfs 由某个问题男设计。(译者:据说那家伙已经被抓了,现在监狱里面,没机会继续开发reiserfs了。)如果发生如非正常关机这样的状况,也许无法运功疗伤,要丢失数据了。
XFS = desiged by SGI for smooth data transfer of large image /
multi-media files (streaming video editing) on IRIX (their in-house
UNIX). Great for sequential access to large files. Origionally
propriatary for Irix, ported to Linux. Irix is no more. I don't know
who is following XFS to ensure problems don't arise.
XFS 由SGI设计,为了在IRIX上平滑地传输大型文件或者多媒体文件(比如:编辑流媒体文件)。在频繁访问大文件方面表现牛逼。属于IRIX专利,移植到linux。
IRIX已不在,真不知道谁来继续XFS,谁来保证使用安全。
JFS = designed by IBM for large databases, focus on fast checks after an
unclean shutdown to get the server back up fast. To do that safely,
note that speed is less of an issue than for the target for XFS. It was
origionally written for OS/2 and then ported by IBM for AIX (their
in-house UNIX). I used to use JFS until a thread somewhere around 6
months ago when we heard from the Debian maintainer for the JFS utils
that IBM had stopped active development and at that time only had one
person watching JFS for bugs on a very part-time basis. That IBM
employee said that he could no longer recommend JFS for production
environments. After this, I changed back to ext3.
JFS 由IBM为大型数据库设计(译者:看到IBM就觉得牛逼),着力于在非正常关机后能够快速地检测,以使服务器快速恢复。为安全地进行如上操作,相比XFS的设计目的而言,速度就靠边了。它最初是为了OS/2编写的,后来移植到了AIX上。我过去一直用JFS,直到6个月前的某天看到一个帖子。帖子说:IBM已经停止了JFS的开发,转而由个把人利用点业余时间看着JFS,记一下bug情况。而那个IBM指派的“负责人”表示,他再也不推荐JFS用于生产环境。
从此,我改用ext3。
In an attempt to get some definitive answers, I threw together some of
the statements I've seen, and all I am asking for is verification (a
simple true/false is enough for most of them).
So, here goes:
为了得到点明确的答案,我把所查到的部分集中起来。我想要的是 求真务实。(给个对/错就行)
(1) ext3 mounts and unmounts slowly, resulting in increased boot times.
(1)ext3 挂载和卸载慢,结果导致启动时间延长。
Mounts of an intact filesystem should be visually instantaneous. If the
filesystem was not cleanly shutdown, you should be worried more about
data integrity than speed of cleaning.
应该说挂载一个文件系统时的速度快慢是易于察觉的。但如果系统非正常关机,相比于恢复的速度,大概你更关心数据的完整性。
(2) Neither JFS nor XFS can be made smaller, although they can be
extended if needed.
(2)JFS和XFS格式的空间能被划分得很小很小,而一旦需要,它们随时能被扩大。
Minor detail. How many times do you try to shrink a filesystem. If you
do need to, make a tarball or, using LVM, make a new LV and copy the
data over, then remove the old LV.
最没意义的细节。能有多少次需要折腾文件系统?!如果真需要,先打个tar包,然后用LVM,建一个新的LVM并把数据包复制过去,最后删掉旧的LV。
(3) JFS performance degrades on larger filesystems, but is least CPU
intensive for smaller file systems.
(3)JFS 在大一点的文件系统上表现欠佳,但在小一点的文件系统上有一点CPU增强效果。
Depends on what you mean by performance and what you mean by larger
filesystems. The larger the filesystem, the larger the journal and the
more backup superblocks that need to be kept in sync.
要看你怎么定义"表现"和“大文件系统”了。系统越大,日志文件越大,需要进行扫描和备份的superblock更多。
(4) ReiserFS can be flaky on a system crash.
(4)ReiserFS在系统崩溃时会分崩离析。
ReiserFS is always flaky.
ReiserFS总是分崩离析。
(5) ReiserFS is the best choice for /var.
(5)ReiserFS是/var的最佳选择。
I used ReiserFS for about a week before my system got corrupted and I
had to reinstall. I wouldn't use it on anything.
在我的系统瘫患到不得不重装之前的1周里,我用的就是ReiserFS。我再也不用它了。
(6) On a continuum, XFS offers the best performance, ext3 offers the
most data integrity / chances of recovering from a crash, and JFS is
in the middle.
(6)综合看来,XFS有最佳磁盘表现,ext3提供了最好的数据完整性和灾难恢复可能,而JFS居于它们之间。
Apples, Oranges, and Pears.(这哥们打不出 囧 字,可怜)
囧……
(7) Mixing too many file systems in one system will degrade performance
(7)在一个系统里混合使用太多的磁盘格式将降低系统性能。
No. If you had a system for editing video, you could use ext2 except
for, e.g. /var/tmp on which you could have XFS (especially on its own
disk or raid0 array).
No。如果你有一个用于编辑视频的系统,除了如/var/tmp这样的地方用XFS外,你可以考虑使用ext2。(特别是系统盘或raid0阵列)
(8) Is there any advantage to using ext2 for /boot rather than ext3?
(8)把/boot弄成ext2是不是比弄成ext3更有好处?
Only in once instance: where drive space is limited you need a separate
/boot, using ext2 instead of ext3 saves the space for the journal.
Since the kernel doesn't change that often, you could leave /boot
mounted ro except when updating the kernel. In this case, a journal
doesn't really help unless you get a crash in the midst of a kernel
update.
只有一种情况:磁盘空间有限,你需要把/boot分开放置,用ext2而不是ext3可以省点日志空间。
由于kernel不经常变化,除了升级kernel之外的时间,你都可以把/boot加载成ro模式(Read Only)。在这种设置下,日志文件并不起作用,除非你升级kernel的时候系统崩了。
Bottom line for your situation:
Use ext3. If you want the ability to change the size of partitions, use
LVM. For a laptop, you may want to put everything in encrypted
partitions (with a separate /boot).
(这是个回帖,上面部分是别人给的建议,下面这段是发帖人的留言)
But all of that still gives me no reason to change all of my ext2 partitions to something else.
Hugo
怎么选,看自己的需求了,反正我留在ext3。* From: "Paul Johnson" <baloo@xxxxxxxxx>
* Date: Sat, 19 Jan 2008 09:04:41 -0800
ext3 isn't noticably slower for user-environments, you can convert to
ext3 without reformatting, and ext2 has very poor crash recovery
compared to 3. tune2fs -j <device> and it'll convert your ext2 to
ext3.
坛子里高人给了个方法,解决占用空间大的问题。
代码: 全选
sudo tune2fs -m 1 /dev/sdX