Interpreting /proc/partitions

Clash Royale CLAN TAG#URR8PPP
I'm confused about the partitions size of a flash memory in my embedded linux device:
/ # cat /proc/partitions
major minor #blocks name
240 0 93184 ndda
240 1 85168 ndda1
240 2 7000 ndda2
240 3 1000 ndda3
I know the partitions corresponding to ndda2 and ndda3 were created to have 7000 kB and 1000 kB of size respectively.
I see ndda is 16 kB larger than the sizes of ndda1 + ndda2 + ndda3.
That is, 93184 - (85168 + 7000 + 1000) = 16.
What is responsible for those 16 kB and where can I get to know more about it?
Now, if I mount ndda1 on a directory, called /nand1, I get:
/ # df
Filesystem 1k-blocks Used Available Use% Mounted on
tmpfs 27044 0 27044 0% /dev/shm
/dev/ndda1 84928 64288 20640 76% /nand1
Its size (84928 kB?) is 240 kB less than what is reported by /proc/partitions.
Again, what structure is responsible for that?
The partition was mounted as vfat.
filesystems embedded flash-memory vfat
add a comment |
I'm confused about the partitions size of a flash memory in my embedded linux device:
/ # cat /proc/partitions
major minor #blocks name
240 0 93184 ndda
240 1 85168 ndda1
240 2 7000 ndda2
240 3 1000 ndda3
I know the partitions corresponding to ndda2 and ndda3 were created to have 7000 kB and 1000 kB of size respectively.
I see ndda is 16 kB larger than the sizes of ndda1 + ndda2 + ndda3.
That is, 93184 - (85168 + 7000 + 1000) = 16.
What is responsible for those 16 kB and where can I get to know more about it?
Now, if I mount ndda1 on a directory, called /nand1, I get:
/ # df
Filesystem 1k-blocks Used Available Use% Mounted on
tmpfs 27044 0 27044 0% /dev/shm
/dev/ndda1 84928 64288 20640 76% /nand1
Its size (84928 kB?) is 240 kB less than what is reported by /proc/partitions.
Again, what structure is responsible for that?
The partition was mounted as vfat.
filesystems embedded flash-memory vfat
add a comment |
I'm confused about the partitions size of a flash memory in my embedded linux device:
/ # cat /proc/partitions
major minor #blocks name
240 0 93184 ndda
240 1 85168 ndda1
240 2 7000 ndda2
240 3 1000 ndda3
I know the partitions corresponding to ndda2 and ndda3 were created to have 7000 kB and 1000 kB of size respectively.
I see ndda is 16 kB larger than the sizes of ndda1 + ndda2 + ndda3.
That is, 93184 - (85168 + 7000 + 1000) = 16.
What is responsible for those 16 kB and where can I get to know more about it?
Now, if I mount ndda1 on a directory, called /nand1, I get:
/ # df
Filesystem 1k-blocks Used Available Use% Mounted on
tmpfs 27044 0 27044 0% /dev/shm
/dev/ndda1 84928 64288 20640 76% /nand1
Its size (84928 kB?) is 240 kB less than what is reported by /proc/partitions.
Again, what structure is responsible for that?
The partition was mounted as vfat.
filesystems embedded flash-memory vfat
I'm confused about the partitions size of a flash memory in my embedded linux device:
/ # cat /proc/partitions
major minor #blocks name
240 0 93184 ndda
240 1 85168 ndda1
240 2 7000 ndda2
240 3 1000 ndda3
I know the partitions corresponding to ndda2 and ndda3 were created to have 7000 kB and 1000 kB of size respectively.
I see ndda is 16 kB larger than the sizes of ndda1 + ndda2 + ndda3.
That is, 93184 - (85168 + 7000 + 1000) = 16.
What is responsible for those 16 kB and where can I get to know more about it?
Now, if I mount ndda1 on a directory, called /nand1, I get:
/ # df
Filesystem 1k-blocks Used Available Use% Mounted on
tmpfs 27044 0 27044 0% /dev/shm
/dev/ndda1 84928 64288 20640 76% /nand1
Its size (84928 kB?) is 240 kB less than what is reported by /proc/partitions.
Again, what structure is responsible for that?
The partition was mounted as vfat.
filesystems embedded flash-memory vfat
filesystems embedded flash-memory vfat
asked Jan 30 at 15:18
Jardel LuccaJardel Lucca
83
83
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Partitions are generally started on a boundary of 2MB to align the filesystem blocks with the physical blocks (which may be 16kB, 64kB or even larger, depending on the device). Misaligned blocks mean that when one filesystem block is updated, two device blocks need to be fetched, the last part of the first block gets updated, and the first part of the second block gets updated, and both blocks are written back. This is two block reads and one block write more than with a properly aligned filesystem.
At the very beginning of the device, you find the partition table itself. That is why the first partition can't begin at block 0.
As to your second question (why is the filesystem smaller than the device): the filesystem needs its management data (e.g. list of free blocks) which is reserved space, and hence not available for direct data storage.
Thanks! That was crystal clear.
– Jardel Lucca
Feb 1 at 18:56
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f497717%2finterpreting-proc-partitions%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Partitions are generally started on a boundary of 2MB to align the filesystem blocks with the physical blocks (which may be 16kB, 64kB or even larger, depending on the device). Misaligned blocks mean that when one filesystem block is updated, two device blocks need to be fetched, the last part of the first block gets updated, and the first part of the second block gets updated, and both blocks are written back. This is two block reads and one block write more than with a properly aligned filesystem.
At the very beginning of the device, you find the partition table itself. That is why the first partition can't begin at block 0.
As to your second question (why is the filesystem smaller than the device): the filesystem needs its management data (e.g. list of free blocks) which is reserved space, and hence not available for direct data storage.
Thanks! That was crystal clear.
– Jardel Lucca
Feb 1 at 18:56
add a comment |
Partitions are generally started on a boundary of 2MB to align the filesystem blocks with the physical blocks (which may be 16kB, 64kB or even larger, depending on the device). Misaligned blocks mean that when one filesystem block is updated, two device blocks need to be fetched, the last part of the first block gets updated, and the first part of the second block gets updated, and both blocks are written back. This is two block reads and one block write more than with a properly aligned filesystem.
At the very beginning of the device, you find the partition table itself. That is why the first partition can't begin at block 0.
As to your second question (why is the filesystem smaller than the device): the filesystem needs its management data (e.g. list of free blocks) which is reserved space, and hence not available for direct data storage.
Thanks! That was crystal clear.
– Jardel Lucca
Feb 1 at 18:56
add a comment |
Partitions are generally started on a boundary of 2MB to align the filesystem blocks with the physical blocks (which may be 16kB, 64kB or even larger, depending on the device). Misaligned blocks mean that when one filesystem block is updated, two device blocks need to be fetched, the last part of the first block gets updated, and the first part of the second block gets updated, and both blocks are written back. This is two block reads and one block write more than with a properly aligned filesystem.
At the very beginning of the device, you find the partition table itself. That is why the first partition can't begin at block 0.
As to your second question (why is the filesystem smaller than the device): the filesystem needs its management data (e.g. list of free blocks) which is reserved space, and hence not available for direct data storage.
Partitions are generally started on a boundary of 2MB to align the filesystem blocks with the physical blocks (which may be 16kB, 64kB or even larger, depending on the device). Misaligned blocks mean that when one filesystem block is updated, two device blocks need to be fetched, the last part of the first block gets updated, and the first part of the second block gets updated, and both blocks are written back. This is two block reads and one block write more than with a properly aligned filesystem.
At the very beginning of the device, you find the partition table itself. That is why the first partition can't begin at block 0.
As to your second question (why is the filesystem smaller than the device): the filesystem needs its management data (e.g. list of free blocks) which is reserved space, and hence not available for direct data storage.
answered Jan 30 at 15:28
wurtelwurtel
10.5k11526
10.5k11526
Thanks! That was crystal clear.
– Jardel Lucca
Feb 1 at 18:56
add a comment |
Thanks! That was crystal clear.
– Jardel Lucca
Feb 1 at 18:56
Thanks! That was crystal clear.
– Jardel Lucca
Feb 1 at 18:56
Thanks! That was crystal clear.
– Jardel Lucca
Feb 1 at 18:56
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f497717%2finterpreting-proc-partitions%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown