Why we don't need to defrag UNIX FS?


 
Thread Tools Search this Thread
Special Forums Hardware Filesystems, Disks and Memory Why we don't need to defrag UNIX FS?
# 1  
Old 09-02-2010
Why we don't need to defrag UNIX FS?

Hi

I am wondering which is the reason why there is no need to defrag file system in UNIX and Linux, and in Windows I must defrag it ?
# 2  
Old 09-02-2010
Try searching this forum for "UNIX defrag".
This User Gave Thanks to frank_rizzo For This Post:
# 3  
Old 09-02-2010
Quote:
Originally Posted by solaris_user
Hi

I am wondering which is the reason why there is no need to defrag file system in UNIX and Linux, and in Windows I must defrag it ?
Mostly because NTFS fragments like hell.

On a disk that's not full, defragmenting a file is as easy as creating a copy of it then replacing the original.
This User Gave Thanks to Corona688 For This Post:
# 4  
Old 09-02-2010
Depends on the filesystem type in both unix and Windows.

Microsoft "fat32" is notorious for fragmentation, but so is unix "ufs".

Microsoft "ntfs" filesystems are broadly comparable to unix "vxfs" filesystems and are less liable to fragment badly unless you let them fill up.
Both can be defragmented with system tools or dump/load.
This User Gave Thanks to methyl For This Post:
# 5  
Old 09-02-2010
Quote:
Originally Posted by methyl
Microsoft "ntfs" filesystems are broadly comparable to unix "vxfs" filesystems and are less liable to fragment badly unless you let them fill up.
I've seen NTFS fragment terribly when only 50% full. It's not as bad as FAT but still not great.
This User Gave Thanks to Corona688 For This Post:
# 6  
Old 09-06-2010
Quote:
Originally Posted by amro1
We DO need from time to time to defrag UNIX related filesystem. The problem is that unlike NTFS (which is VERY GOOD, well designed, originated in absolutely terrific OpenVMS, file system)
MS must have made an absolute hash of it, then because, as I've said, I've seen it fragment terribly on drives only 50% full. It certainly doesn't seem to make any effort to obey your ideal of squashing everything at the head of the drive, either.
Quote:
However, if you on single drive PC with Linux on it and do something that makes a lot of small files, then removes them and then do it over again, your system will be fragmented as a hell.
I use a distro that keeps 1.9 gigs of metadata in a tree of 100,000 tiny files with frequent replacement. I've seen ReiserFS fragment badly on that(the files didn't fragment, but the directories themselves did, leading to very slow ls), but not the more common Linux filesystems.
Quote:
By doing that, the restored files fill into the drive one by another, no gaps and no interleaving.
You've got an odd idea of fragmentation. It doesn't mean "all files in one giant clump at the start of the drive", which is a recipe for fragmentation -- growing files will have no room to expand, and get scattered in pieces when they do.

And there's certainly better alternatives to dumping the entire filesystem, like shake.
This User Gave Thanks to Corona688 For This Post:
# 7  
Old 09-06-2010
Here...

Dear Corona688, you confuse binary tree algorithm for file seeking with an actual allocation i-nodes on physical drive. The gaps that left after removal of files and filled with parts of other files cause the fragmentation. When file open for reading, it goes through the chain and as parts of the file allocated in the areas that are not compactly located, the drive has to performs extra spins in order for perpendicularly moving heads to be on-time for reading/writing in the area. Along with disks' interleaving functionality it makes drive access very slow. That is exactly what fragmentation is. "shake" is one of many options available, again it is not universal and it is not capable of performing defragnetation on all kinds of file system used in UNIX land. "dump"-"restore" is a standard universal way of dealing with the problem, for enterprise level systems, at least for last 20 years.
This User Gave Thanks to amro1 For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Change unix permission when I don't own the file

Hi, A file is transferred from a Windows server(say username : user1) to Unix server via ftp. In unix, the permission of the file for a user, say user2 will be "-rw-r-----". Since the user1 is the owner of the file, user2 is not able to change the file permission using chmod. Is there... (5 Replies)
Discussion started by: merin
5 Replies

2. UNIX for Advanced & Expert Users

don't understand the unix script

if {"$my_ext_type" = MAIN]; then cd $v_sc_dir Filex.SH $v_so_dir\/$v_fr_file Can somebody tell me what does this suggest. I am pretty new to unix and I am getting confused. What i understood from here is If we have a file extension name as MAIN which we have then we change the directory to... (1 Reply)
Discussion started by: pochaman
1 Replies

3. Shell Programming and Scripting

don't know how to implentment as unix sh script

for each file if file name like xx* for each line in a file if substring(3,6) found in another txt file output to file-a( filename = orginal file + _a) else output to file-b( filename = orginal file + _a) end Next Line (4 Replies)
Discussion started by: ttivanwan@yahoo
4 Replies

4. Programming

Why I don't have CC1 in my Unix?

gcc works find in my Unix. But when I want to use cc1, system reports: "bash: cc1: command not found". Any clue? Thank you! (2 Replies)
Discussion started by: meili100
2 Replies

5. UNIX for Dummies Questions & Answers

I don't want to go to jail. so I want to start using unix

I use Mac OSX and have been given all of my video editing software... illegally. I don't want to use it anymore and heard that Unix was the way to go. So that is why I am here. What video editing software is out there for Unix. I think I have Unix. Do I? I am sorry and if all anyone can... (0 Replies)
Discussion started by: moz1979
0 Replies

6. UNIX for Dummies Questions & Answers

which unix?? <donīt know where to post>

Iīm struggling to find a system I like and thatīs not to overwhelming.. Iīve been using Ubuntu/Linux and itīs allright except that itīs pretty buggy and boots extremely slow. Iīm in need of a system that offers good programming features, simple or no x server, fast to boot and STABLE. Donīt care... (2 Replies)
Discussion started by: riwaTNT
2 Replies

7. UNIX for Dummies Questions & Answers

I want to cheaply build my own Linux/Unix PC, but don't know where to start

I want to cheaply build my own PC that will run the latest versions of Linspire, Fedora Core, FreeBSD and Solaris, but I don't know where to start. This PC doesn't have to be particulary fast. It's video performance need not be top notch, however, sound quality and sound performance must rock!... (4 Replies)
Discussion started by: Mr. Nice Guy
4 Replies

8. UNIX for Dummies Questions & Answers

defrag

is there a command to degragment or clean the disk drives on an HP SCO Unix maching? (6 Replies)
Discussion started by: rnpeters
6 Replies
Login or Register to Ask a Question