A filesystem is a method of storing and organizing computer files and their data.

learn more… | top users | synonyms (2)

204
votes
3answers
51k views

What is the purpose of the lost+found folder in Linux and Unix?

There is a folder at the root of Linux and Unix operating systems called /lost+found/ What is it for? Under what circumstances would I interact with it? How would I interact with it?
96
votes
4answers
13k views

/usr/bin vs /usr/local/bin on Linux

Why are there so many places to put a binary in Linux? There are atleast these five: /bin/ /sbin/ /usr/bin/ /usr/local/bin/ /usr/local/sbin/ And on my office box, I do not have write permissions ...
50
votes
3answers
13k views

Why hard links not allowed to directories in UNIX/Linux

I read in text books that UNIX/Linux doesn't allows hard links to directories but soft links do. Is it because, when we have cycles and if we create hardlinks, and after some time we delete the ...
47
votes
3answers
2k views

What happens when I run the command cat /proc/cpuinfo?

What happens when I write cat /proc/cpuinfo. Is that a named pipe (or something else) to the OS which reads the CPU info on the fly and generate that text each time I call it?
47
votes
3answers
2k views

Why does '/' have an '..' entry?

This just baffles me. Why does the root directory contain a reference to a parent directory? bob@bob:/$ ls -a . build home lib32 mnt .rpmdb sys vmlinuz .. cdrom ...
37
votes
5answers
23k views

What is a Superblock, Inode, Dentry and a File?

From the article Anatomy of Linux File Systems by Tim Jones, I read that Linux views all the file systems from the perspective of a common set of objects and these objects are superblock, inode, ...
37
votes
5answers
17k views

Can I configure my Linux system for more aggressive file system caching?

I am neither concerned about RAM usage (as I've got enough) nor about losing data in case of an accidental shut-down (as my power is backed, the system is reliable and the data are not critical). But ...
36
votes
1answer
1k views

Why are there so many different ways to measure disk usage?

When I sum up the sizes of my files, I get one figure. If I run du, I get another figure. If I run du on all the files on my partition, it doesn't match what df claims is used. Why are there so many ...
34
votes
7answers
2k views

ZFS under linux, does it work?

Could I get ZFS to work properly in Linux? Are there any caveats / limitations?
32
votes
2answers
1k views

Why is '.' a hard link in Unix?

I've seen many explanations for why the link count for an empty directory in Unix based OSes is 2 instead of 1. They all say that it's because of the '.' directory, which every directory has pointing ...
28
votes
4answers
19k views

Reserved space for root on a filesystem - why?

I understand that by default, newly created filesystems will be created with 5% of the space allocated for root. I also know you can change the defined space with: tune2fs -m 1 /dev/sdXY What I'm ...
28
votes
4answers
837 views

Append huge files to each other without copying them

There are 5 huge files ( file1, file2, .. file5) about 10G each and extremely low free space left on the disk and I need to concatenate all this files into one. There is no need to keep original ...
28
votes
9answers
27k views

Mount Google Drive in Linux?

Now that Google Drive is available, how do we mount it to a Linux filesystem? Similar solutions exist for Amazon S3 and Rackspace Cloud Files.
27
votes
3answers
2k views

Why are text files 4kB?

For some reason, when I make a text file on OS X, it's always at least 4kB, unless it's blank. Why is this? Could there be 4,000 bytes of metadata about 1 byte of plain text?
26
votes
2answers
5k views

What is this new /run filesystem?

I just ran df -h a minute ago and noticed a filesystem has been added that I'm not familiar with. Does anyone know why /run exists? Is this something that's been added by the kernel? By Arch Linux? ...
24
votes
1answer
1k views

Why does “ls *” take so much longer than “ls”?

I have a couple of files in a directory: $ ls | wc -l 9376 Can anybody explain why there is such a huge time difference in using ls * and ls? $ time ls > /dev/null real 0m0.118s user ...
23
votes
1answer
1k views

What do the device files in /dev actually do?

(Not a duplicate of Understanding /dev and its subdirs and files) I was browsing around my filesystem and for the first time I took a second to analyze my /dev directory. I was surprised by the ...
23
votes
5answers
9k views

How can I create a /dev/null-like “blackhole” directory?

I would like to create a "/dev/null" directory (or a "blackhole" directory) such that any files written to it are not really written, but just disappear. I have an application that writes out large ...
22
votes
5answers
4k views

Why do hard links exist?

I know what hard links are, but why would I use them? What is the utility of a hard link?
22
votes
2answers
5k views

What mount points exist on a typical Linux system?

I have 2 questions. During Linux installation we specify memory space for 2 mount points - root and swap. Are there any other mount points created without the users notice? Is this statement ...
22
votes
1answer
2k views

Purpose of /dev/zero?

I tried to cat /dev/zero, and it didn't seem to do anything. I googled /dev/zero, and it says it's basically a blank file with infinite size. Is cat printing an infinite number of non-existent ...
21
votes
5answers
2k views

How to tell which file is original if hard link is created

For example, I have a file myold_file. Then I use ln to create a hard link as mylink: ln myold_file mylink Then, even by using ls -a, I cannot tell which is the old one. Is there anyway to tell?
20
votes
4answers
3k views

What doesn't need defragmentation? Linux or the ext2 ext3 FS?

Why don't you have to defrag a Linux system? Because it's using the ext2/ext3 file system or because it's Linux? That's relevant, because a have a double boot system (W7 / Ubuntu) and a common ...
20
votes
2answers
16k views

timestamp, modification time, and created time of a file

I just know that ls -t, -f give different sorting of files and subdirectories under a directory. Now I wonder what are the differences between timestamp, modification time, and created time of a ...
19
votes
2answers
1k views

Where do the files go if you mount a drive to a folder that already contains files?

I just accidentally mounted a new drive to a folder that already contained files. I don't care about them and have them somewhere else, but that folder appears empty now. I'm curious what happened ...
19
votes
1answer
15k views

How do I find on which physical device a folder is located?

Specifically: I did sudo mkdir /work, and would like to verify it indeed sits on my harddrive and not mapped to some other drive. How do I check where this folder is physically located?
19
votes
3answers
5k views

What is the difference between procfs and sysfs?

What is the difference between procfs and sysfs? Why are they made as file systems? As I understand it, proc is just something to store the immediate info regarding the processes running in the ...
18
votes
5answers
3k views

Do journaling filesystems guarantee against corruption after a power failure?

I am asking this question on behalf of another user who raised the issue in the Ubuntu chat room. Do journaling filesystems guarantee that no corruption will occur if a power failure occurs? If this ...
18
votes
1answer
15k views

How can I increase the number of inodes in an ext4 filesystem?

I had a problem (new to me) last week. I have a ext4 (Fedora 15) filesystem. The application that runs on the server suddenly stopped. I couldn't find the problem at first look. df showed 50% ...
18
votes
4answers
25k views

Recovering ext4 superblocks

Recently, my external hard drive enclosure failed (the hard drive itself powers up in another enclosure). However, as a result, it appears its EXT4 file system is corrupt. The drive has a single ...
17
votes
5answers
3k views

What's the most “correct” mount point for a permanent NTFS partition?

I have an NTFS partition (containing a Windows installation from which I dual boot) that I would like to permanently mount from my Linux installation. Problem is, I can't figure out what the ...
16
votes
2answers
868 views

Where is filename stored on a filesystem?

Where is filename stored on a filesystem? It's not in inode or with the actual file content since we have hard link that two filenames can point to the same inode.
16
votes
8answers
664 views

How to tell what type of filesystem you're on?

Is there a command to tell what type of filesystem you're using?
16
votes
2answers
1k views

Why is JFS so obscure?

When I first got into using Slackware years ago I quickly learned to love JFS over ext3 or reiserfs given that it was reliable and if there was an unclean shutdown, its disk checking was very very ...
16
votes
7answers
4k views

Linux equivalent to ReadyBoost?

Is there a kernel module or some other patch or something similar to Windows' ReadyBoost? Basically I'm looking for something that allows disk reads to be cached on a Flash drive.
16
votes
2answers
2k views

understanding “mount” as a concept in the OS

I want to understand what mounting is. It is used in different contexts and situations and I can't find resources which: Describe the mount concept Explain the actions taken by the ...
16
votes
3answers
1k views

File system for an SSD drive

I always thought that traditional file systems, are geared and optimized for non-ssd drive, where, for instance, data locality is important, and fragmentation is problematic. Is there a file system ...
16
votes
2answers
315 views

How does “rm” on a NTFS filesystem differs from Windows' own implementation?

I have an external USB disk with an NTFS filesystem on it. If I remove a file from Windows and I run one of the several "undelete" utilities (say, TestDisk) I can easily recover the file (because ...
15
votes
2answers
4k views

What happens when you delete a hard link?

If you do rm myFile where myFile is a hard link, what happens?
15
votes
3answers
11k views

What is the most high-performance Linux filesystem for storing a lot of small files (HDD, not SSD)?

I have a directory tree that contains many small files, and a small number of larger files. The average size of a file is about 1 kilobyte. There are 210158 files and directories in the tree (this ...
15
votes
2answers
3k views

How can I find the number of files on a filesystem?

I want to know how many files I have on my filesystem. I know I can do something like this: find / -type f | wc -l This seems highly inefficient. What I'd really like is to do is find the total ...
14
votes
6answers
620 views

Is it bad to have filesystems nearly full?

Example I have large/small sized filesystems JFS2/EXT3, whatever (and various OS, Linux, AIX), but some of them are on ex.: 90%, 95%, 98% usage. Questions: Having filesystems nearly full does ...
14
votes
3answers
2k views

Is there a limit of hardlinks for one file?

Is there a limit of number of hardlinks for one file? Is it specified anywhere? What are safe limits for Linux? And what for other POSIX systems?
14
votes
4answers
7k views

Clear unused space with zeros (ext3,ext4)

How to clear unused space with zeros ? (ext3,ext4) I'm looking for something smarter than cat /dev/zero > /mnt/X/big_zero ; sync; rm /mnt/X/big_zero Like FSArchiver is looking for "used space" ...
14
votes
2answers
388 views

Can I list the filesystems a running kernel can support?

I'm trying to detect what filesystems a kernel can support. Ideally in a little list of their names but I'll take anything you've got. Note that I don't mean the current filesystems in use, just ones ...
14
votes
4answers
4k views

Is there a file search engine like “Everything” in Linux?

On Windows there a nice file search engine called Everything, which is (unlike find) very fast and (unlike locate) always returns up to date results. AFAIK it works by filling a database from the ...
14
votes
3answers
966 views

Securely delete files on btrfs filesystem

Sometimes, there's the need to delete a file in a filesystem, and make sure that the file is truly gone. A file that contains sensitive passwords, for example, should be throughly wiped from the disk. ...
13
votes
3answers
1k views

How can I de-fragment a drive using Ubuntu?

Is it necessary to defrag drives in Ubuntu? If so, how do I do it and how often should it be done?
13
votes
3answers
2k views

File system compatible with all OSes?

I use Linux and Mac OS X on a regular basis, and sometimes I have to use Windows. I need to use a flash drive on all three, and I need a filesystem that will work well on all of them. None of the ...
13
votes
3answers
2k views

Automatically rename files when they are placed in a specific directory

Is it possible to automatically rename a file when it's placed in a specific directory? For example I have a directory named "dir0".I move or copy a file named "file1" to "dir0".then "file1" should ...