Questions tagged [filesystems]

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

Filter by
Sorted by
Tagged with
137 votes
4 answers
15k 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 ...
Gilles 'SO- stop being evil''s user avatar
21 votes
3 answers
12k views

What are the different ways to set file permissions, etc., on GNU/Linux?

On Unix, a long time back, I learned about chmod: the traditional way to set permissions on Unix (and to allow programs to gain privileges, using setuid and setgid). I have recently discovered some ...
ctrl-alt-delor's user avatar
570 votes
3 answers
483k views

What is a bind mount?

What is a “bind mount”? How do I make one? What is it good for? I've been told to use a bind mount for something, but I don't understand what it is or how to use it.
Gilles 'SO- stop being evil''s user avatar
125 votes
4 answers
143k 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 ...
suitedupgeek's user avatar
  • 1,353
55 votes
7 answers
26k views

The merits of a partitionless filesystem

I ran into something a couple of weeks ago that I'd never seen before: A filesystem (ext3 I believe) installed to a storage device without a partition. In essence /dev/sdb was the entire filesystem. I ...
sysadmin1138's user avatar
111 votes
6 answers
68k 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 ...
xenoterracide's user avatar
165 votes
4 answers
325k views

How does the sticky bit work?

SUID The sticky bit applied to executable programs flagging the system to keep an image of the program in memory after the program finished running. But I don't know that what it's stored in memory....
lotusirous's user avatar
  • 3,639
158 votes
5 answers
174k views

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

From the article Anatomy of the Linux file system by M. 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, ...
Navaneeth Sen's user avatar
675 votes
5 answers
219k views

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

Why are there so many places to put a binary in Linux? There are at least these five: /bin/ /sbin/ /usr/bin/ /usr/local/bin/ /usr/local/sbin/ And on my office box, I do not have write permissions to ...
Lazer's user avatar
  • 34.7k
218 votes
11 answers
401k views

Tool to monitor folder for new files and run command whenever new file is detected

How can I immediately detect when new files were added to a folder within a bash script? I would like the script to process files as soon as they are created in the folder. Are there any methods aside ...
norq's user avatar
  • 4,063
77 votes
6 answers
209k 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% ...
piovisqui's user avatar
  • 875
17 votes
3 answers
14k views

ext4: How to account for the filesystem space?

I've recently formatted a 1.5 TB drive with the intention of replacing ntfs with ext4. Then I noticed that the files I saved don't fit on the new partition. df: ext4 (ext3 & ext2 show the same ...
misc's user avatar
  • 173
98 votes
6 answers
145k 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" ...
Grzegorz Wierzowiecki's user avatar
90 votes
3 answers
42k 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?
slm's user avatar
  • 366k
41 votes
4 answers
29k views

What file systems on Linux store the creation time?

Are there any (good known, reliable) file systems on Linux that store the creation time of files and directories in the i-node table? If there are, is the "changed" time replaced by the creation ...
franziskus's user avatar
33 votes
2 answers
41k 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 correct:...
John Eipe's user avatar
  • 673
129 votes
2 answers
338k 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 ...
Tim's user avatar
  • 100k
156 votes
7 answers
80k views

Why are hard links to directories not allowed in UNIX/Linux?

I read in text books that Unix/Linux doesn't allow hard links to directories but does allow soft links. Is it because, when we have cycles and if we create hard links, and after some time we delete ...
user3539's user avatar
  • 4,338
53 votes
10 answers
105k views

How to change filesystem UUID (2 same UUID)?

I have a fedora guest OS in VMware. I want to expand /boot partition, so I add another virtual disk to this VM, and try to clone the disk. After dd if=/dev/sda1 of=/dev/sdb1, blkid report that /dev/...
LiuYan 刘研's user avatar
68 votes
9 answers
85k views

Extend a LUKS encrypted partition to fill disk

I recently upgraded my disk from a 128GB SSD to 512GB SSD. The / partition is encrypted with LUKS. I'm looking for help extending the partition to use all the free space on the new disk. I've ...
NisplayDame's user avatar
  • 1,701
31 votes
1 answer
2k views

When did directories stop being readable as files?

I have the 1st edition of The Unix Programming Environment book. In chapter 2, the authors state that directories are readable as files, and mention some facts about the format of these files. They ...
Tyler's user avatar
  • 683
29 votes
3 answers
43k views

Difference between block size and cluster size

I've got a question concerning the block size and cluster size. Regarding to what I have read about that I assume the following: The block size is the physical size of a block, mostly 512 bytes. ...
pluckyDuck's user avatar
16 votes
3 answers
5k views

A virtual file containing the concatenation of other files

Is there a way of creating a filesystem object akin to this: mknod files p cat file1 file2 ... fileN > files but such that it can be seeked in, as if it were a regular file?
Witiko's user avatar
  • 781
240 votes
5 answers
996k 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 ...
xanpeng's user avatar
  • 5,655
104 votes
6 answers
48k 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 ...
dogbane's user avatar
  • 29.3k
18 votes
3 answers
981 views

How can I be sure that a directory or file is actually deleted?

I know that most files, when deleted, aren't actually removed from the disk, and can be recovered later. How can I ensure that a directory I had deleted will actually be removed from the disk? Are ...
jcora's user avatar
  • 3,884
18 votes
4 answers
9k views

Find filesystem of an unmounted partition from a script

I'm writing a custom automated install using AIF (Arch Installation Framework), and I need to find the filesystem on a partition given a partition. So far I have this: grok_partitions () { local ...
beatgammit's user avatar
  • 7,493
7 votes
1 answer
2k views

du results on filesystem inconsistent with df

What explains the discrepancy in usage (82 GB vs 13 GB) that I see below? Using df: $ df -h / Filesystem Size Used Avail Use% Mounted on /dev/sda2 96G 82G 9.9G 90% / ...
Amelio Vazquez-Reina's user avatar
775 votes
3 answers
422k 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?
Wesley's user avatar
  • 14k
87 votes
4 answers
51k 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 ...
Navaneeth Sen's user avatar
83 votes
2 answers
6k views

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

This has always puzzled 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 ...
Nathan Osman's user avatar
  • 6,200
43 votes
10 answers
8k views

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

Is there a command to tell what type of filesystem you're using?
Moshe's user avatar
  • 739
18 votes
3 answers
26k views

Why are filenames that start with a dot hidden? Can I hide files without using a dot as their first character?

Initially I thought it was a coincidence, but now I see there's even a tag for it: all hidden file names start with a dot. Is this a convention? Why was it chosen? Can it be changed? Or in other words ...
JMCF125's user avatar
  • 1,052
13 votes
3 answers
26k views

file block size - difference between stat and ls

I've noticed that when I do a: ls -ls file It provides block count, say 8 blocks. When I do: stat file I notice that the block count is 16, twice the number given by ls. The block size on my ...
stantona's user avatar
  • 465
5 votes
5 answers
6k views

How does one inspect the directory structure information of a unix/linux file?

In Unix file systems directories are just special files with special directory structures that hold the child filename, filename size and inode reference number. The actual file metadata beyond ...
Biff's user avatar
  • 281
147 votes
2 answers
344k views

How to show the filesystem type via the terminal? [duplicate]

Possible Duplicate: How to tell what type of filesystem you’re on? Find filesystem of an unmounted partition from a script How can I quickly check the filesystem of the partition? Can I do that ...
tux_drummer's user avatar
  • 1,813
102 votes
5 answers
173k views

How do you make samba follow symlink outside the shared path

This is Ubuntu server 10.04 64 and samba 3.4.7. I have a shared directory /home/mit/share and another one /home/temp that I link into the shared one: ln -s /home/temp /home/mit/share/temp But on ...
mit's user avatar
  • 1,413
36 votes
2 answers
23k views

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

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 ...
T. Brian Jones's user avatar
31 votes
3 answers
4k views

How does Unix keep track of a user's working directory when navigating the file system?

Say I log into a shell on a unix system and begin tapping away commands. I initially begin in my user's home directory ~. I might from there cd down to the directory Documents. The command to change ...
marked-down's user avatar
153 votes
2 answers
161k views

What is this folder /run/user/1000?

What is this folder: /run/user/1000 on my Fedora system and what does it do? ~ $ df -h Filesystem Size Used Avail Use% Mounted on tmpfs 1.2G 20K 1.2G 1% /run/user/1000 EDIT: 7 ...
somethingSomething's user avatar
48 votes
4 answers
13k 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 files,...
rush's user avatar
  • 27.2k
30 votes
4 answers
43k views

Find which process is modifying a file [duplicate]

A specific file on our production servers is being modified at apparently random times which do not appear to correlate with any log activity. We can't figure out what program is doing it, and there ...
Wayne Conrad's user avatar
16 votes
6 answers
20k views

Linux local directory permissions as question-marks for non-root

I've seen cases like that with faulty storage devices, with faults in remote storage (SAN, NAS), I think I've even seen something similar caused by mount permissions. But it's the first time I see ...
netikras's user avatar
  • 405
242 votes
9 answers
496k views

Find where inodes are being used

So I received a warning from our monitoring system on one of our boxes that the number of free inodes on a filesystem was getting low. df -i output shows this: Filesystem Inodes IUsed ...
phemmer's user avatar
  • 71.3k
183 votes
7 answers
96k views

Can I watch the progress of a `sync` operation?

I've copied a large file to a USB disk mounted on a Linux system with async. This returns to a command prompt relatively quickly, but when I type sync, of course, it all has to go to disk, and that ...
mattdm's user avatar
  • 39.9k
95 votes
7 answers
34k 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?
Luc M's user avatar
  • 4,055
75 votes
6 answers
140k views

How to safely turn off swap permanently and reclaim the space? (on Debian Jessie)

I installed Debian Jessie with default partitioning on my SSD drive. My current disk partitioning looks like this: As I have 16GB of RAM, I assume I don't need swap. But since I have other disk ...
Vlastimil Burián's user avatar
64 votes
5 answers
265k 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 ...
tlvince's user avatar
  • 1,156
60 votes
3 answers
32k views

understanding "mount" as a concept in the OS [duplicate]

I want to understand what mounting is. It is used in different contexts and situations (directories, flash drives, network cards, etc) and I can't find resources which: Describe the mount concept; ...
Vass's user avatar
  • 5,311
57 votes
3 answers
43k views

Where are filenames stored on a filesystem?

Where are filenames 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.
yegle's user avatar
  • 1,149

1
2 3 4 5
12