Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a 'whiteout' (S_IFWHT) in Unix?

One of the possible file types that can be obtained using stat(2) is S_IFWHT, also called a whiteout. What is it?

like image 424
GingerBadger Avatar asked Jun 25 '20 18:06

GingerBadger


1 Answers

The official Linux kernel contains no such thing. On UNIX systems where it does exist, and possibly in some unofficial patches for Linux, it's a type of file that stops further lookup for a file but reports that it doesn't exist. It's useful with union and overlay filesystems, to be able to remove files that exist in the base image. The Linux kernel's overlayfs does have whiteouts, but they're S_IFCHR files with major and minor number 0, not S_IFWHT.

like image 68
Joseph Sible-Reinstate Monica Avatar answered Sep 28 '22 04:09

Joseph Sible-Reinstate Monica