On Ubuntu 14.04, I am checking the filesystem for my home based on a file new in it:$ stat -f new  File: new    ID: 38d4cd29e44142c6 Namelen: 255     Type: ext2/ext3Block size: 4096       Fundamental block size: 4096Blocks: Total: 144152970  Free: 79424314   Available: 72095994Inodes: Total: 36626432   Free: 35430143I am also checking it by another way:$ cat /etc/fstab# /etc/fstab: static file system information.## Use 'blkid' to print the universally unique identifier for a# device; this may be used with UUID= as a more robust way to name devices# that works even if disks are added and removed. See fstab(5).## <file system> <mount point>   <type>  <options>       <dump>  <pass># / was on /dev/sdb3 during installationUUID=8620616e-3745-420e-9082-c6f9df5b0f15 /               ext4    errors=remount-ro 0       1# /home was on /dev/sdb4 during installationUUID=bcd7575f-97d7-47f8-951a-83675195061c /home           ext4    defaults        0       2# swap was on /dev/sdb2 during installationUUID=aba3f8f2-9a25-4ef3-96ba-c12b40622eca none            swap    sw              0       0Added: another way:$ stat  new  File: new  Size: 928         Blocks: 8          IO Block: 4096   regular fileDevice: 804h/2052d  Inode: 28188755    Links: 1Access: (0622/-rw--w--w-)  Uid: ( 1000/       t)   Gid: ( 1000/       t)Access: 2015-12-19 06:33:07.842559147 -0500Modify: 2013-06-11 12:54:44.944836000 -0400Change: 2015-03-25 11:15:20.778708140 -0400 Birth: -What does ID mean in the out put of stat -f? Is it thefilesystem ID of the filesystem in my home partition? What does it depend on? Not on the mount point?What does the first column in /etc/fstab? is it the filesystem IDof each filesystem?What are the differences between the two kinds of ID given by thetwo ways?why does stat -f show the file system type is ext2/ext3 while my home filesystem type is ext4?Added: what does Device mean in the output of stat without -f? Is it an id of something?
Do both stat -f and cat /etc/fstab show file system ids?
linux;filesystems;stat
According to man stat the ID is the ID of the filesystem, whatever that may or may not mean. I'm guessing this is generated when the filesystem is.The first column references the partition UUID, not the filesystem ID. It's a departure from the more traditional /dev/sdXX, mostly because with modern systems it's sometimes possible for the traditional drive order to be shuffled around in the BIOS, but the UUID will remain the same.As 1) and 2) point out, they're different IDs denoting entirely different aspects. They're roughly as related as your Social Security Number and your home address in that they're both associated with you, but that's it.Because ext4 is an extension to ext3 which is an extension to ext2. The part of the signature that stat looks at is the same in each case, hence the identification.Again, according to man stat, when you omit '-f' stat looks at the file itself rather than the filesystem it's on, and the value after 'Device' is the hex-and-decimal value of the filesystem's device ID. I should probably also point out that with stat -f you did not in fact get the information about the filesystem you wanted to get information about.Yes, but what does this all mean?A UUID is assigned by the partition manager when you create the partition. You can change it manually if you want but there's almost never a reason to and generally every reason not to. Modern linux systems prefer to use the UUID rather than the device number to determine what is mounted where, just in case new hardware is added which changes the device letter ordering. See here for more information about UUIDs.A device id is the combination of major and minor number that identifies that particular block device. In your case, '804' identifies the fourth partition of the first SCSI-like drive located according to the BIOS. In traditional terms, this would be /dev/sda4.They are two different ways of identifying the same thing, via different methods -- /dev/sda4 will always point to the fourth partition on the first SCSI-like device, which can fail spectacularly if you add another hard drive to your system and for some reason the BIOS identifies it first; UUID=8620616e-3745-420e-9082-c6f9df5b0f15 refers to the partition in your system with that unique identifier, regardless of how your devices are shifted around internally.