Tag Info

Hot answers tagged

26

The tool to display inode detail for a filesystem will be filesystem specific. For the ext2, ext3, ext4 filesystems (the most common Linux filesystems), you can use debugfs, for XFS xfs_db, for ZFS zdb. For btrfs some information is available using the btrfs command. For example, to explore a directory on an ext4 filesystem (in this case / is dev/sda1): # ...


6

There's a reason all those utilities use recursive directory traversal to discover changed files. There isn't any better way. Inotify exists, but does AFAIK not scale to several thousand directories. Not only that, but you have to listen continuously (say, as a daemon) and if you miss a single update then you have to recheck everything. Ain't there ...


6

# rm -rf /path/to/undeletable rm: cannot remove ‘/path/to/undeletable’: Is a directory rm calls stat(2) to check whether /path/to/undeletable is a directory (to be deleted by rmdir(2)) or a file (to be deleted by unlink(2). Since the stat call fails (we'll see why in a minute), rm decides to use unlink, which explains the error message. # rmdir ...


5

Use attributes: chattr -R +i files (as root) will add the +i attribute recursively to your folders and files which will prevent ANY alternations. Note that root will also be locked and you would need to unset the i manually every time. Ownership and alike will be left unchanged.


5

Each filesystem has its strengths. For example, ext4 is simple and functional, btrfs is specialized for data storage (at least when it is end user ready), f2fs is optimized for flash memory storage and reiserfs is good at handling millions of small files. Hence, a user may want to format its system partition to ext4, bulk data partition to btrfs, flash drive ...


5

The easiest way to do this is to create your backing file as a sparse file; that is, make it 1GB with truncate -s 1G disk.img instead of dd if=/dev/zero bs=1048576 count=1024 of=disk.img (or whatever). Nicely, truncate is also far faster. If you do an ls -l on the file, it'll show as 1GB—but that's only its apparent size. du disk.img will give the actual ...


4

A BIOS boot partition doesn't contain a filesystem; it's just a place to put some GRUB code that on an MBR disk would've been located immediately after the boot sector, before the start of the first partition. On a GPT disk, that area is used by the (larger) partition table and isn't available for bootloader code, so the bootloader code goes in a small ...


3

I found lazytime, a mount option for ext4, that solves this satisfactorily for me. https://lwn.net/Articles/620086/ This mode causes atime, mtime, and ctime updates to only be made to the in-memory version of the inode. The on-disk times will only get updated when (a) when the inode table block for the inode needs to be updated for some non-time ...


3

The value in the superblock shown by tune2fs is the first inode number usable for new files, while the root directory must always exist when the file system is created. https://ext4.wiki.kernel.org/index.php/Ext4_Disk_Layout#Special_inodes documents the inode numbers which are used internally by file systems features.


3

No, because there is no standard Linux distribution. Linux is just a kernel, and doesn't specify anything about user-space, including file layout. If you want to narrow this down to a subset of Linux distributions, you might be able to find something (with, as you note, /bin/sh as a good candidate) However, the kernel itself does have some special ...


3

Usually the intention is to optimize performance by chosing a filesystem which better suits the purpose and type of files stored beneath that path. For example, some filesystems handle many small files better than others. Take a look at https://en.wikipedia.org/wiki/Comparison_of_file_systems to get an idea.


2

You might want to try systemtap. Here is a slightly modified example showing opens, reads and writes every 100ms: #! /usr/bin/env stap global fileread, filewrite probe syscall.open.return { if ($return != -1) { printf("open, %s, %d/%d\n", user_string($filename), pid(), $return) } } probe syscall.read.return { p = pid() fd = $fd ...


2

Firstly, writing a sparse image to a disk will not result in anything but the whole of the size of that image file - holes and all - covering the disk. This is because handling of sparse files is a quality of the filesystem - and a raw device (such as the one to which you write the image) has no such thing yet. A sparse file can be stored safely and securely ...


2

With GNU coreutils (Linux, Cygwin) since version 8.22, you can use du --inodes, as pointed out by lcd047. If you don't have recent GNU coreutils, and there are no hard links in the tree or you don't care if they're counted once per link, you can get the same numbers by filtering the output of find. If you want the equivalent of du -s, i.e. only toplevel ...


2

Not sure what you mean by "a directory and its users inside". The root user can always write to any file, so to make a file or directory writable only to root you make it non-writable by user, group, and others. Note that the webroot dir is supposed to be writable by the apache user, so what you're trying to do is to give it the incorrect permissions. ...


2

It's not available as part of standard Unix or a graphical Linux interface. Linux system administrators can use overlayfs. Actually one of the most important uses is to allow modifications to a running LiveCD system, e.g. installing extra packages. There are also equivalents in FUSE, which can be used on Linux without root privileges. There will be ...


2

If you are using mkfs.ext4, you have to pass -E root_owner=your_uid:your_gid, this is usually passed in an 'extra options' textbox in gui partition tools. If you dont do this (< mkfs 1.42) then the person running the gui tool will get the permissions. Nowdays, for security, it assigns them to root:root (0:0). If you ever go back to fat32 or ntfs, you ...


2

In general: Boot a livecd, containing all needed drivers (ZFS) Backup your partition Format it with ZFS Unpack the backup into the new partition Update initrd, make sure all needed modules are included (on debian update-initramfs and configuring /etc/initramfs-tools, but on redhat it will be different). Update grub (e.g. filesystem uuids) Maybe reinstall ...


2

The copy doesn't do any conversion itself. Basically the "conversion" happens as part of the read process. All file access is through VFS (virtual filesystem) calls. The copy reads data from one file using VFS calls and writes it to another the same way, equally for any file attributes it copies. Copy doesn't really know anything about disk formats like ...


1

I have bad news for you: if I'm reading the code in http://lxr.free-electrons.com/source/fs/efs/ correctly, Linux -- even the very newest version -- does not implement write access to EFS, probably because it was believed that the only use for a filesystem that old was to migrate data off of old disks.


1

Is Filesystem the mount point? You could try the mount -o remount,rw -t efs /dev/sdb1 Filesystem option to remount the filesystem as read-write.


1

Try umount -f /media/sdb1 or umount -l /media/sdb1. If all else fails you can manually edit /etc/mtab to remove the offending mount entry.


1

As your df output suggests, your drive is actually 15 GB in size, out of which 5.5 GB (38%) are used and 9.2 GB are free space. So the installation is fine. You can also see in your fdisk -l output that the end sector matches the final sector (off by one - nothing strange) and the start is at the beginning (minus the head sectors). However the problem ...


1

disks can be mounted on any directories, there are however pitfall. all disk must be mounted before application (e.g. drupal) is started. "deepest" directories must be mounted last (e.g mount /storage/drupalprivate/ before /storage/drupalprivate/data1 ). any existing file or dir under /storage/drupalprivate/data1 on your SSD disk, will be unavailable/hide ...


1

You forgot to resize the filesystem. See man resize2fs (for ext4) or man btrfs-filesystem (for btrfs).


1

The path name is inferred from the route from the file's directory entry back to the root, /. A file's name is stored in its directory, so the same "file" can be called two different things simultaneously. The time taken to move a file within the same filesystem is independent of the file size. In response to your statements: a filename of a file ...


1

Why would you want to use such, let's say, exotic filesystems (for a notebook)? btrfs compression is disabled by default. I would stay with xfs, ext4 or btrfs. They are all used and developed heavily and broad support (means much testing, fast bug fixing) and xfs and ext4 are old enough. The last one is problematic because it's relatively new. So, I don't ...


1

Linux's auditd can get the information for points 1 and 2. Assuming you are running RHEL/CentOS 6 and have an nfs share mounted as /mnt/nfs/foo: $ tree /mnt/nfs/foo /mnt/nfs/foo |-- a | `-- foo |-- b `-- bar You will need to define the following rules in /etc/audit/audit.rules: # Delete existing rules -D # Set buffer size -b 320 # Log read and ...


1

I suppose you are talking about fragmented directory blocks. While you create file/ directory , it goes in the parent directory blocks. With time, you create and delete the objects and this blocks become fragmented. This is called non-contiguous directory. There must be feature provided by file system to make them compact . look into the particular file ...


1

I think I know how it works. I connected another disk to my machine because it has a big almost empty partition ~458G . I checked its free space via e2freefrag: HISTOGRAM OF FREE EXTENT SIZES: Extent Size Range : Free extents Free Blocks Percent 64M... 128M- : 6 146233 0.12% 128M... 256M- : 5 322555 ...



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