Giter Club home page Giter Club logo

sblkdev's Issues

why the device size in `lsblk` and `df` not equal?

the module param is given 100M size and lsblk is 100M too, but df shows only 89M๏ผŒ why they are not equal?
the following is the commands and outputs from my machine

root@suse ~/sblkdev (master)# insmod sblkdev.ko catalog="sblkdev1,204800"
root@suse ~/sblkdev (master)# lsblk | sed -n '1p;$p'
NAME     MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
sblkdev1 253:0    0  100M  0 disk 
root@suse ~/sblkdev (master)# 
root@suse ~/sblkdev (master)# mkfs.ext4 /dev/sblkdev1
mke2fs 1.47.0 (5-Feb-2023)
Creating filesystem with 102400 1k blocks and 25584 inodes
Filesystem UUID: c3e0c089-d5e9-4e2f-ba31-e5d4514c589d
Superblock backups stored on blocks: 
        8193, 24577, 40961, 57345, 73729

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done 

root@suse ~/sblkdev (master)# mount /dev/sblkdev1 /mnt
root@suse ~/sblkdev (master)# df -h | sed -n '1p;$p'
Filesystem      Size  Used Avail Use% Mounted on
/dev/sblkdev1    89M   46K   82M   1% /mnt
root@suse ~/sblkdev (master)# fdisk -l /dev/sblkdev1 
Disk /dev/sblkdev1: 100 MiB, 104857600 bytes, 204800 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
root@suse ~/sblkdev (master)# 

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.