Linux does not mount the device to obtain file system information for the device

Source: Internet
Author: User

After a block device is mounted, you can view the file system information for the device via the DF or Mount command. However, sometimes it is necessary to judge without mounting the device, and the following method can be used:

(1) View file system type command: File-sl/dev/testvg/lv0 Sample output:/dev/testvg/lv0:linux Rev 1.0 ext2 FileSystem data (large files) (2) View EXT2/3 /4 File System details: command: tune2fs-l/dev/testvg/lv0 sample output (intercept part): Free blocks:1287586free inodes:327669first block:0block size:409 6Fragment size:4096reserved GDT blocks:319blocks per group:32768fragments per group:32768inodes per group:8192 PS: there's a command to display more file system Information: Dumpe2fs/dev/testvg/lv0 | Less the command displays a lot of information, preferably with less or grep using PPS: The program wants to get the file system block size and can use the STAT system call: Example: #include <stdio.h> #include <sys/         types.h> #include <sys/stat.h> int main (void) {struct STAT st;         Stat ("/", &st);        printf ("%d\n", st.st_blksize); return 0;}

Linux does not mount the device to obtain file system information for the device

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.