linux - How executable binaries works after unmounting root file system in single user mode? -


my root filesystem got corrupted , fix went in single user mode , ran fsck on unmounted root filesystem.my question how /sbin/fsck command works after unmounting root file system , located?

os: redhat linux

in linux source, if ask umount root file system, doesn't happen - source makes clear comment , tricksy code:

if (mnt == current->fs->root.mnt && !(flags & mnt_detach)) {     /*      * special case "unmounting" root ...      * try remount readonly.      */     down_write(&sb->s_umount);     if (!(sb->s_flags & ms_rdonly))         retval = do_remount_sb(sb, ms_rdonly, null, 0);     up_write(&sb->s_umount);     return retval; } 

this why binaries on root file system still present; they've not gone away.


Comments

Popular posts from this blog

amazon web services - S3 Pre-signed POST validate file type? -

c# - Check Keyboard Input Winforms -