0

There is an existing linux server which has a mount,when I ls on that mount location its a file with 0 size. But the original location has files under it.

>df
/dev/mapper/Data2-INT_Internal
                     140493728 123468868   9888196  93% /data/int/internal

Here you see /data/int/internal path is mapped to /dev/mapper/Data2-INT_Internal, but when I go to /dev/mapper/Data2-INT_Internal location, its a file with 0 size. How is that possible because there is lot of data under /data/int/internal.

intmeta01:/dev/mapper> ls -l Data2-MAD_Internal
brw-rw---- 1 root disk 251, 0 2013-02-26 16:55 Data2-MAD_Internal

Please help me resolving this mystery.

Wasi Ahmad
  • 35,739
  • 32
  • 114
  • 161
user204069
  • 1,215
  • 3
  • 19
  • 25

1 Answers1

1

The file you are looking at is a block device. You can tell by the b in front of the permissions.

Block devices are basically just named entry points or handles. The device file itself doesn't "contain" data in any meaningful sense, it just points to some driver that can handle requests.

The 251, 0 you see is the major and minor device number, which tells the kernel which driver or subsystem should handle requests. Neither is a file size.

that other guy
  • 116,971
  • 11
  • 170
  • 194