Tag Info

New answers tagged

2

Since 35 years, this option no longer exist. Any decent fs will not give you control over inode numbers. What you can do is to parse the restoresymtsble from ufsrestore, but it is undocumented and binary. Star uses the same basic algorithm to track renames and puts the database into star-symtable. This file is a textfile and there is the program star_sym ...


0

With respect to ext4 the debugfs tool can be used in this way (adequate precaution should be taken as debugfs can corrupt your fs) Goal to create a file at inode 77 with the name /lucky77. We assume that inode 77 is yet unused/free/available and as is the filename /lucky77. Further we work offline, on an unmounted fs. debugfs -w /dev/ext4fsblockdev ...


0

AFAIK, there's no way to copy an inode to another inode without also copying the file's data. There's also no API for requesting a new file to have a specific inode number. So all you can do is cp -a old new && rm old to get a new inode for the file, but you can't choose what it will be. And of course this copies the entire data, so it's slow. ...


1

It does show the timestamp (with nanoseconds precision) but in hex; it's the field after crtime:, e.g. in your output 0x55b65ebc:970fe7cc. The part after the colon is the nanoseconds. This article gives more details and explains how to calculate the timestamp/nanoseconds. So, e.g. to convert the hex values to a timestamp a la stat you could run: date -d ...


2

It looks like debugfs does not yet support printing out the sub-second portion (the upper 30 bits of i_xtime_extra) of timestamps in its asctime-based format. From http://git.kernel.org/cgit/fs/ext2/e2fsprogs.git/tree/debugfs/debugfs.c : if (is_large_inode && large_inode->i_extra_isize >= 24) { fprintf(out, "%s ctime: 0x%08x:%08x -- ...


1

I know I'm late to the party, but I believe this pure bash (or other shell which accept double star glob) solution could be much faster in some situations: shopt -s globstar # to enable ** glob in bash for dir in */; do a=( "$dir"/**/* ); printf "%s\t%s\n" "$dir:" "${#a[*]}"; done output: d1/: 302 d2/: 24 d3/: 640 ...



Top 50 recent answers are included