Tag Info

New answers tagged

1

Tracking freed blocks is unavoidable in any decent file system and ZFS is no exception. There is however a simple way under ZFS to have a nearly instantaneous directory deletion by deferring the underlying cleanup. It is technically very similar to Gilles' suggestion but is inherently reliable without requiring extra code. If you create a snapshot of your ...


3

What you're asking for is impossible. Or, more precisely, there's a cost to pay when deleting a directory and its files; if you don't pay it at the time of the deletion, you'll have to pay it elsewhere. You aren't just removing a directory — that would be near-instantaneous. You're removing a directory and all the files inside it and also recursively ...


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.


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 ...


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.


0

I believe this will give you what you want: (cat /proc/filesystems | awk '{print $NF}' | sed '/^$/d'; ls -1 /lib/modules/$(uname -r)/kernel/fs) | sort -u Explanation Based on my best understanding: cat /proc/filesystems | awk '{print $NF}' | sed '/^$/d' gives you all the filesystems that are natively supported by the kernel (like sysfs) along with ...


0

I am running arch linux and the suggested solution cat /proc/filesystems | awk '{print $NF}' | sed '/^$/d' did not provide me a complete list of filesystems that my kernel currently supports/has the modules to support. After digging around it looks like /proc/filesystems just lists the filesystems that already have their kernel modules loaded (or don't need ...


-1

Your question have been asked here. I've modified Mr. paxdiablo's script to suit your problem: #!/bin/bash while true; do mkdir nu for i in dir1/* dir2/* dir3/*; do ln -s $i nu/$(basename $i) done mv smartdir ole mv nu smartdir rm -rf ole done So dir1, dir2, dir3 are directories you want to symlink to, and smartdir is the ...


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 ...


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 ...


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 ...


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.


-1

First change user and group to root chown -R root:root /tmp/uploads then change permissions so that only root can write chmod -R 755 /tmp/uploads EDIT: If you only need to restore files owners, I would save your files and owner in a file (There sure are better ways to do this, but this is the first thing that comes to my mind). Be sure ...


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. ...


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 ...


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 ...


0

The root partition is on an LVM logical volume (LV) named root in a volume group (VG) named I0-vg, so you must first expand the underlying physical volume (PV), then expand the LV, then expand the filesystem: pvresize /dev/<pv_dev> lvresize --extents +100%FREE I0-vg/root resize2fs /dev/mapper/I0--vg-root where <pv_dev> is the block device of ...


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 ...


0

It's in your reserve block count: ext3: Block count: 256000 Reserved block count: 0 ext4: Block count: 256000 Reserved block count: 12800 the fix: # tune2fs -m 0 e4fs


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 ...


1

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


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 ...


0

You can try (partition is an example). sudo debugfs /dev/xvda1 use dump to write inode data to a file. sudo dumpe2fs /dev/xvda1 man is your friend, these should give you some ideas.


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): # ...


0

You can use your programming language of choice, open the directory as if it was a file and read bytes from the resulting file handle. That's not going to tell you much, though, since it will just be garbage (with a few recognizable strings in it) as long as you don't know how it's organized. How it is organized is pretty much an implementation issue for the ...


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 ...


0

Are you wanting to create this image with a 800MB of space, so you can copy to sd cards. But not wanting to wast space when storing the image. If so may I suggest compression, such as bzip. It will depend on unused blocks being initialised to zero though.


-1

Hope I understand the question properly: To shrink a file-system and partition. Use gparted.


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 ...


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 ...


3

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 ...


-1

I read the rules and it does seem to indicate open ended questions like this are not encouraged. Here is a quick link to them: http://unix.stackexchange.com/help However in case it is allowed, I would suggest reading Linux CompTIA or any of the very popular certification courseware. You will need more than just the understanding of disks to become ...


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 ...


0

Not entirely sure what you are looking for. Does xfs_admin suit your purpose here ? NAME xfs_admin - change parameters of an XFS filesystem SYNOPSIS xfs_admin [ -eflpu ] [ -c 0|1 ] [ -L label ] [ -U uuid ] device xfs_admin -V DESCRIPTION xfs_admin uses the xfs_db(8) command to modify various parameters of a filesystem. ...


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 ...


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.


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 ...


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 ...


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.


0

Try commenting out following line in /etc/pam.d/sshd sessionoptional pam_keyinit.so force revoke if you comment it out, new virtual sessions should allow ecryptfs mount to work. This worked for me with screen sessions. See this post.


0

If the drive is available in BIOS, you can try with GParted I think it is not included in the default mint installation, but for sure it is in the repos. Once installed you can see in the top right corner if the drive is available. If it is available you can format it an then the OS should recognize it. Another thing to check is the SATA cable - I've ...


0

First you need to see you HDD in BIOS. If you saw them. The try to use program victorya HDD. This program can try "restore" lost sectors. And may be your got the working HDD. But unfortunately this hard disk drive is garbage - 99%.


1

Hugo Mills provided an answer on the btrfs mailing-list: Basically "single" mode distributes 1GiB chunks, which is good enough for my use case.


0

If I copy 50 GB onto the filesystem, it causes 100 GB to be used. If I copy 300 GB onto the filesystem, it causes the smaller drive to be full What about the extra 200 GB on the bigger drive? Does it still use that extra 200 GB, but just doesn't mirror it? No, it doesn't. The result at that point is that the filesystem is full. To allocate a ...


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 ...


1

How do I configure a data scrubbing daemon that automatically detects when I randomly lose a HDD sector causing an archive to not pass it's checksum verification, then to copy a backup onto another sector. It's built in to Btrfs. Try: btrfs scrub start It has never yet happened to me that an error was found, but I expect that if one is found then: ...



Top 50 recent answers are included