ext4

timestamp accuracy on EXT4 (sub millsecond)

与世无争的帅哥 提交于 2019-11-29 06:39:16
I was writing some code in Vala where I would first get the system time, then create a file, then retrieve the time stamp of that file. The timestamp would always be earlier that the system time, somewhere between 500 and 1500 micro seconds which didn't make sense. I then wrote a simple shell script: while true; do touch ~/tmp/fred.txt stat ~/tmp/fred.txt|grep ^C done With the the following result: Change: 2013-01-18 16:02:44.290787250 +1100 Change: 2013-01-18 16:02:44.293787250 +1100 Change: 2013-01-18 16:02:44.296787250 +1100 Change: 2013-01-18 16:02:44.298787248 +1100 Change: 2013-01-18 16

Setting/changing the ctime or “Change time” attribute on a file

我的梦境 提交于 2019-11-29 04:32:41
I wish to change the timestamp metadata on files in Java using the java.nio.Files class. I would like to change all 3 Linux/ext4 timestamps (last modified, access, and changed). I am able to change the first two timestamp fields as follows: Files.setLastModifiedTime(pathToMyFile, myCustomTime); Files.setAttribute(pathToMyFile, "basic:lastAccessTime", myCustomTime); However, I am unable modify the last Change: time on the file. Also, it is concerning that there is no change timestamp mentioned in the documentation . The closest available attribute is creationTime , which I tried without any

How to store one billion files on ext4? [closed]

六眼飞鱼酱① 提交于 2019-11-28 21:12:26
I only created about 8 million files, then there was no free inode in /dev/sdb1. [spider@localhost images]$ df -i Filesystem Inodes IUsed IFree IUse% Mounted on /dev/sdb1 8483456 8483456 0 100% /home Someone says can specify the inode count when format the partition. e.g. mkfs.ext4 -N 1000000000. I tried but got an error: "inode_size (256) * inodes_count (1000000000) too big...specify higher inode_ratio (-i) or lower inode count (-N). ". What's the appropriate inode_ratio value? I heard the min inode_ratio value is 1024 for ext4. Is it possible to store one billion files on a single partition?

Unix File System: How are file names translated to disk sectors?

自作多情 提交于 2019-11-28 06:17:13
问题 A very basic question. What is the exact sequence of steps executed when I try to open a file-descriptor, by providing fully-qualified path to the file. I am looking for how this works on Linux given a file name - how is it translated to inode and disk-sector does linux file system (specifically ext3 and ext4) maintain some kind of filename to inode mapping? 回答1: In addition of tmp's answer: Files really are inodes. Usually, a given file has some entry in some directory pointing to its inode.

Setting/changing the ctime or “Change time” attribute on a file

纵饮孤独 提交于 2019-11-27 18:27:54
问题 I wish to change the timestamp metadata on files in Java using the java.nio.Files class. I would like to change all 3 Linux/ext4 timestamps (last modified, access, and changed). I am able to change the first two timestamp fields as follows: Files.setLastModifiedTime(pathToMyFile, myCustomTime); Files.setAttribute(pathToMyFile, "basic:lastAccessTime", myCustomTime); However, I am unable modify the last Change: time on the file. Also, it is concerning that there is no change timestamp mentioned

How to store one billion files on ext4? [closed]

有些话、适合烂在心里 提交于 2019-11-27 13:35:06
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . I only created about 8 million files, then there was no free inode in /dev/sdb1. [spider@localhost images]$ df -i Filesystem Inodes IUsed IFree IUse% Mounted on /dev/sdb1 8483456 8483456 0 100% /home Someone says can specify the inode count when format the partition. e.g. mkfs.ext4 -N 1000000000. I tried but got

Is rename() without fsync() safe?

喜你入骨 提交于 2019-11-26 10:35:52
问题 Is it safe to call rename(tmppath, path) without calling fsync(tmppath_fd) first? I want the path to always point to a complete file. I care mainly about Ext4 . Is the rename() promised to be safe in all future Linux kernel versions? A usage example in Python: def store_atomically(path, data): tmppath = path + \".tmp\" output = open(tmppath, \"wb\") output.write(data) output.flush() os.fsync(output.fileno()) # The needed fsync(). output.close() os.rename(tmppath, path) 回答1: No. Look at