Hot answers tagged

61

An ISO file isn't a file system. It contains a file system. From a usage point of view, it functions the same way as a hard disk or USB device or DVD - you need to have a mount point, i.e. a place in your file system where you can mount it in order to get at the contents.


38

There are three separate concepts here: A block device, which is a physical or virtual device that represents a series of equal sized data blocks. HDDs are block devices. So are data CDs. A filesystem, which defines a way of storing data in a block device that represents a series of files and directories and other filesystem information. ext3 is a file ...


11

No, the ISO image file is not a file system in its own right. Just like a partition can contain a file system, but isn't a file system, does an ISO image file contain a file system, but it isn't a file system. But you need a file system for two things: a place to store the .iso file (assuming if it doesn't come as a shiny silver disc) a directory where to ...


5

If you're using ntfs-3g to mount your NTFS filesystem, the windows_names option will prevent files with problematic names from being created: ntfs-3g -o windows_names ...


4

It doesn't duplicate the information: you can have more suffixes in a given directory than the plain ".1" or ".3", e.g., (depending on the platform) letters following the numbers. For example, Debian follows the ".3" with a an application suffix such as "pm" for Perl modules. Here is (part) of the listing from /usr/share/man/man1, to illustrate: ...


4

You could safely use ext3 with noatime option: then only actual file writes would touch your flash device in write mode. The ext3fs journal is a good thing in case of embedded system that may get lack of power suddenly. I personally run this way a few Raspberry PI's equipped with simple SD memory cards for a couple of years (24/7, not backed up by UPS and ...


3

A disk should grant that a sector is written atomically. The sector size was 512 bytes and today is typically 4096 bytes for larger disks. In order to get no problem from partially written "blocks", it is important to write everything in a special order. Note that the only reason why there could be a partially written part in the filesystem is a power ...


3

The "blocks" that stat() reports are 512 byte units. The normal block size used by ext4 is 4kb, or 8 of these "blocks". That means that the space used by a file on ext4 must be an integer multiple of 8 "blocks", and so the smallest size used by any file less than or equal to 4096 bytes in size is 8 512 byte blocks.


3

Quote from this answer : As of Linux 4.1, fallocate(2) supports the FALLOC_FL_INSERT_RANGE flag, which allows one to insert a hole of a given length in the middle of a file without rewriting the following data. However, it is rather limited: the hole must be inserted at a filesystem block boundary, and the size of the inserted hole must be a ...


3

No. The mount options trump all. That's what they're for: to ensure that nothing ever gets executed directly from that filesystem. To counter noexec, you can run most programs indirectly by invoking their launcher: If the program is a script (starting with a shebang), invoke the interpreter and pass it the script as its first argument. If the program is a ...


2

At this point I'd say the main reason is backwards compatibility — the directory split was there right from the start, in V4 (that's the fourth release of UNIX, not SVR4). Back then there could have been any number of reasons: avoiding having to handle many files in a single directory, thinking of the manual pages as parts of a book...


2

This is normal behaviour. Mounted filesystems are normally not re-exported by nfs. You have to share both. E.g. you can add this to MachineA exports: /data/Storage MachineB(rw,sync,no_subtree_check,no_root_squash) You might also need to add crossmnt option into the /data options in exports of MachineA or nohide to /data/Storage options in order ...


2

The code that generates this file is in the unix_seq_show() function in net/unix/af_unix.c in the kernel source. Looking at include/net/af_unix.h is also helpful, to see the data structures in use. The socket path is always the last column in the output, and the Android kernel source matches the stock kernel in this respect. So unless I'm mistaken, that ...


2

Ext4 wasn't designed for flash media. It can work, and it's a safe value due to the extremely wide usage it gets, but it isn't necessarily the best choice, especially on flash media that doesn't do wear leveling. UBIFS is specifically designed for raw NAND flash. It doesn't work on arbitrary block devices, it requires an underlying MTD storage device (as ...


2

Structures fetched from Ultrix 3.0 v7 of restor so variations can occur: ftp://ftp.uvsq.fr/pub/tuhs/PDP-11/Distributions/dec/Ultrix-3.0/v7restor/include/sys/ The s5fs is rather archaic but ...: Disk layout could be something like: [B][S][Inode List][ Data Blocks ] | | | +-- Super Block +----- Boot Area The Super Block holds data for the file ...


1

This appears to be a bug in older versions of LVM. A bug that could be corrected by compiling from source with a different set of flags to add support for thin devices. I can not speak for the SystemRescueCD you mentioned, because I have never used it, but it may be using an older version of LVM, for whatever reason, which may have this very bug. Since ...


1

Some of the parameters given to mount(8) are translated to flags specified in the mountflags parameter to mount(2): sync is MS_SYNCHRONOUS; dirsync is MS_DIRSYNC; relatime is MS_RELATIME; rw is the default, so it can't be specified; ro would be MS_RDONLY.


1

So I made a mountinfo parser […] You're better off using setmntent() and getmntent() that are provided in the GNU C runtime library. My approach was to convert the mount options into the appropriate mountflags and to give special options straight to data […] What you need to do is take the mnt_opts given to you by getmntent() and ...


1

In most cases, you wouldn't move the files from one filesystem to another. If you're enlarging the disk in a virtual machine or grabbing more space from the same disk, you'd enlarge the partition containing the filesystem then enlarge the filesystem to fill the partition (which commands to use depends on the partition type and filesystem type). If you're ...


1

There's a haskell project called "dotfs" that does something like what you're describing. This may be defunct, however. It would be easy to put something together in python using fusepy. I've attached a gist (based on fusepy-base) which does almost what you're asking, by simply running the contents of each file through a bash echo, and expanding everything ...


1

Modular config files as a text processing function What you're asking for is more properly text processing than file processing, and it's largely dependent on what program is consuming the text files. The traditional straightforward way to do what you want is to have a top-level file that includes other files in a modular way, such as: ~/.bash_profile: ...


1

You can use GNU stat on Linux: stat --file-system --format=%T /tmp/subdir/whatever tmpfs


1

That depends on the underlying storage technology. Some storage allows a certain block size to be stored atomically, typically a power of 2 which is at least 256 and usually in the 1kB—4kB range. If that's the case, then the filesystem layer can replace blocks in place, provided that the replacement of the block yields a valid system state. This is fine ...


1

If you have a ext2/3/4 filesystem you can use debugfs for a low-level look at an inode. For example, to play without being root: $ truncate -s 1M myfile $ mkfs.ext2 -F myfile $ debugfs -w myfile debugfs: stat <2> Inode: 2 Type: directory Mode: 0755 Flags: 0x0 Generation: 0 Version: 0x00000000 User: 0 Group: 0 Size: ...


1

Thanks for Edouard Fazenda and thrig. I have solved this problem with their help. I mounted my /home with fourth field rw,relation,user. After read some doc,I use fourth field rw,relation,exec,suid. Now everything goes fine!Thanks again.


1

I believe Unix V1 would be run from a single disk. It had no real VFS. You can find the system filesystem at the root of the namespace, /. No indirection required; no SYSTEMROOT = c:/windows variable. Remember this was hand-written assembly code. Minimalist ideas were very useful. The ideas here are often described in terms of their elegance. I want to run ...


1

This is because the device files you find in /dev aren't actually mount points *. They're just handy filesystem-based references to access the devices themselves. You can see a similar sort of hierarchy under /sys — particularly, look in /sys/block. Why is something like /dev/sda a special type of file rather than a directory under which there are ...


1

The read-only test only reads. That's basically the default testing method for just about everything and pretty much the same what disks do for SMART self-tests. The non-destructive read-write test works by overwriting data, then reading to verify, and then writing the original data back afterwards. The only way to verify that writing data works is by ...


1

As you can see, what you're trying to do is not possible as you're moving files that are still open by another process, so they will continue to get updated properly, avoiding space that is already used by them. The free space reported is actually right, even if you don't see the files in the directory listing anymore. As long as the file is open by a ...


1

If a program has a file open when you delete it, the kernel only marks it as deleted, but doesn't free the disc space, to avoid breaking the program (it's can't know if the file is important to the function of the program). When the program closes the file the disc space is freed. When that happens you will see the "(deleted)" when you look at ...



Only top voted, non community-wiki answers of a minimum length are eligible