Linux - KernelThis forum is for all discussion relating to the Linux kernel.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I use different distributives (Mandrake, Slackware, ASP. Kernel version is 2.4.??) and mount my file system (e2fs) with sync key. I create a small file (512 bytes< filesize< blocksize), look its i-node and the number of its block. Then I use dd, bpe, lde to look my file's data. OK! I delete the file (rm myfile) and create a new one. The new file occupies old file's block. cat newfile shows new data but dd, bpe, lde show old file's data even 1 hour later (sync and mount with remount key don't change anything)! Why? I disconnect (plug off) my computer from electric power, restart... Wow! dd, bpe, lde show new (real) data! I think caching is guilty of this situation. Can I turn off (temporarily) caching in my file system?
PS. I did't have this trouble with old versions of kernel (2.2.??)
Thanks!
I did'n remount the filesystem because it was mounted as /
I used only mount with 'remount' option.
The sequence of my actions: #fillfile 900 a //my program to create a file with a homogeneous content (900 characters 'a') #ls -li a //get the file's i-node (INODENUMBER) #lde -i INODENUMBER /dev/hda3 //get the file's data block (DATABLOCK) #lde -b DATABLOCK /dev/hda3|less //ok! data are present #rm a //delete the file #fillfile 900 b //create a file (900 characters 'b') #sync //from 3 to 5 attempts of synchronization
... //or remounting #sync #ls -li b //the same i-node (usually) #lde -i INODENUMBER /dev/hda3 //the same data block (usually) #lde -b DATABLOCK /dev/hda3|less //OLD data are present! bpe, dd show the same too #cat b //I see NEW data!!! lde, bpe, dd ... //OLD data again
fillfile is a simple program. It uses open (fname, O_WRONLY|O_CREAT|O_TRUNC|O_SYNC) to create and write(...) to write data. Other version of fillfile uses fopen, setvbuf(fs,NULL,_IONBF,0), fwrite, fflush, sync. But there are no differences between the end results.
Now I have solved the problem. I use #hdparm -f /dev/hda3 instead of sequence of sync!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.