A filesystem is a way to organize and store computer files with their data.

learn more… | top users | synonyms (2)

242
votes
3answers
70k 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?
116
votes
4answers
18k 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 ...
64
votes
5answers
17k 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 ...
55
votes
3answers
5k 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?
52
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 ...
44
votes
1answer
2k 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 ...
43
votes
5answers
23k 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 ...
39
votes
5answers
29k 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
4answers
26k 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 ...
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?
34
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 ...
34
votes
9answers
34k 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.
29
votes
1answer
21k 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?
29
votes
5answers
12k 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 ...
28
votes
5answers
5k 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?
28
votes
3answers
3k 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?
28
votes
2answers
7k 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? ...
28
votes
4answers
910 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 ...
25
votes
1answer
2k 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 ...
25
votes
2answers
28k views

timestamp, modification time, and created time of a file

I just know that ls -t and ls -f give different sorting of files and subdirectories under a directory. What are the differences between timestamp, modification time, and created time of a file? How ...
24
votes
3answers
6k 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 ...
23
votes
1answer
2k 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
1answer
29k views

How to determine the filesystem of an unmounted device? [duplicate]

Possible Duplicate: Find filesystem of a partition from a script How to show the filesystem type via the terminal? I'm looking for a command that yields the filesystem type as mount would ...
22
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?
22
votes
2answers
6k 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
3k 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 ...
22
votes
4answers
37k 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 ...
21
votes
1answer
21k 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% ...
20
votes
2answers
2k 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 ...
20
votes
4answers
5k 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
4k views

How do I remove a file with no permissions?

A hacker has dropped a file in my tmp dir that is causing issues. Nothing malicious except creating GB's of error_log entries because their script is failing. However, the file they are using to ...
19
votes
5answers
4k 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
2answers
8k views

What happens when you delete a hard link?

If you do rm myFile where myFile is a hard link, what happens?
18
votes
2answers
1k 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.
18
votes
3answers
15k 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 ...
18
votes
6answers
6k 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 ...
18
votes
6answers
4k 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 ...
17
votes
8answers
882 views

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

Is there a command to tell what type of filesystem you're using?
17
votes
7answers
5k 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.
17
votes
2answers
4k 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 ...
17
votes
2answers
61k views

How to get the complete and exact list of mounted filesystems in Linux?

I usually use mount to check which filesystems are mounted. I also know there is some connection between mount and /etc/mtab but I'm not sure about the details. After reading How to check if /proc/ is ...
17
votes
4answers
12k 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" ...
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
3answers
5k 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 ...
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
2answers
5k views

Birth is empty on ext4

I was just reading up on the Birth section of stat and it appears ext4 should support it, but even a file I just created leaves it empty. ~ % touch test ...
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
335 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
439 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 ...
15
votes
3answers
1k 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. ...