Different results between df & fdisk commands The 2019 Stack Overflow Developer Survey...

How do I design a circuit to convert a 100 mV and 50 Hz sine wave to a square wave?

Make it rain characters

Would an alien lifeform be able to achieve space travel if lacking in vision?

How to support a colleague who finds meetings extremely tiring?

Is it ethical to upload a automatically generated paper to a non peer-reviewed site as part of a larger research?

One-dimensional Japanese puzzle

Button changing its text & action. Good or terrible?

How to type a long/em dash `—`

60's-70's movie: home appliances revolting against the owners

What do I do when my TA workload is more than expected?

Do working physicists consider Newtonian mechanics to be "falsified"?

Simulating Exploding Dice

Is 'stolen' appropriate word?

how can a perfect fourth interval be considered either consonant or dissonant?

Could an empire control the whole planet with today's comunication methods?

Mortgage adviser recommends a longer term than necessary combined with overpayments

"... to apply for a visa" or "... and applied for a visa"?

What information about me do stores get via my credit card?

Match Roman Numerals

Is there a writing software that you can sort scenes like slides in PowerPoint?

How did the audience guess the pentatonic scale in Bobby McFerrin's presentation?

Why did Peik Lin say, "I'm not an animal"?

Accepted by European university, rejected by all American ones I applied to? Possible reasons?

Python - Fishing Simulator



Different results between df & fdisk commands



The 2019 Stack Overflow Developer Survey Results Are In
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)Linux server boot issueHow to migrate SD Card with Linux?fsck.ext4 unable to resolve UUIDReplaced a RAID 10 drive on my Debian server - what do I do next?Unable to mount external drive or sshfsNo boot partition at all, but the server still boots upI connected my usb hdd driver. CentOS7 don't mount itDual boot Windows 10 after initial Arch Linux instilationHow to set or change the 2.2 GiB size of AWS instance-store backed root volume?Masked/Hidden Partition





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







0















I did resizing of my disk partition (/dev/mmcblk0p2), but after the process is done, what i get is the following results:



df -h :



Filesystem      Size  Used Avail Use% Mounted on
/dev/mmcblk0p2 3.1G 3.1G 2.5M 100% /
devtmpfs 360M 0 360M 0% /dev
tmpfs 489M 4.0K 489M 1% /dev/shm
tmpfs 489M 26M 464M 6% /run
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 489M 0 489M 0% /sys/fs/cgroup
/dev/mmcblk0p1 40M 16M 25M 40% /boot
tmpfs 98M 0 98M 0% /run/user/0
tmpfs 98M 0 98M 0% /run/user/1000



and fdisk -l result is :



Disk /dev/mmcblk0: 7.4 GiB, 7948206080 bytes, 15523840 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
Disklabel type: dos
Disk identifier: 0x00000000

Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 49152 131071 81920 40M 83 Linux
/dev/mmcblk0p2 131072 15523839 15392768 7.3G 83 Linux



why in df i don't get the full size of /dev/mmcblk0p2 ???



resizing done by the following set of commands



totalSize=`sfdisk -l /dev/mmcblk0 | grep "Disk /dev/mmcblk0" | cut -d ' ' -f 7`;

p2Start=`sfdisk -d /dev/mmcblk0 | grep "/dev/mmcblk0p2" | cut -d ',' -f 1 | cut -d '=' -f 2 | awk '{$1=$1};1'`;

newSize=$((totalSize - p2Start));

sfdisk -d /dev/mmcblk0 > /tmp/DiskLayout;

sed -i -E "s//dev/mmcblk0p2.*size=[ ]*[0-9]+, type=83//dev/mmcblk0p2 : start= ${p2Start}, size= ${newSize}, type=83/" /tmp/DiskLayout;

sfdisk /dev/mmcblk0 --no-reread < /tmp/DiskLayout;

reboot

resize2fs /dev/mmcblk0p2

reboot


resize2fs output:



Filesystem at /dev/mmcblk0p2 is mounted on /;
on-line resizing required old_desc_blocks = 1, new_desc_blocks = 1 Performing an on-line resize of /dev/mmcblk0p2 to 1924096 (4k) blocks.


this is a part of a process for preparing sd in mass production, so it must be done dynamically using a split script parts










share|improve this question









New contributor




rami khawaly is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
















  • 1





    It looks like it should have worked... are you sure that resize2fs completed without errors? (no harm running it again)

    – Attie
    yesterday













  • No, seems ok. here is the output: Filesystem at /dev/mmcblk0p2 is mounted on /; on-line resizing required old_desc_blocks = 1, new_desc_blocks = 1 Performing an on-line resize of /dev/mmcblk0p2 to 1924096 (4k) blocks.

    – rami khawaly
    yesterday











  • 1924096 * 4096 = 7.3 GiB... which isn't 3.1 G or ~14.8 G... can you refresh your question with new output from df -h and fdisk -l?

    – Attie
    yesterday













  • just updated the output

    – rami khawaly
    yesterday











  • Things still don't add up... fdisk and resize2fs now agree, and df is the odd one out... are you sure you're interrogating the correct / same system? IP conflict or something weird?

    – Attie
    yesterday




















0















I did resizing of my disk partition (/dev/mmcblk0p2), but after the process is done, what i get is the following results:



df -h :



Filesystem      Size  Used Avail Use% Mounted on
/dev/mmcblk0p2 3.1G 3.1G 2.5M 100% /
devtmpfs 360M 0 360M 0% /dev
tmpfs 489M 4.0K 489M 1% /dev/shm
tmpfs 489M 26M 464M 6% /run
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 489M 0 489M 0% /sys/fs/cgroup
/dev/mmcblk0p1 40M 16M 25M 40% /boot
tmpfs 98M 0 98M 0% /run/user/0
tmpfs 98M 0 98M 0% /run/user/1000



and fdisk -l result is :



Disk /dev/mmcblk0: 7.4 GiB, 7948206080 bytes, 15523840 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
Disklabel type: dos
Disk identifier: 0x00000000

Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 49152 131071 81920 40M 83 Linux
/dev/mmcblk0p2 131072 15523839 15392768 7.3G 83 Linux



why in df i don't get the full size of /dev/mmcblk0p2 ???



resizing done by the following set of commands



totalSize=`sfdisk -l /dev/mmcblk0 | grep "Disk /dev/mmcblk0" | cut -d ' ' -f 7`;

p2Start=`sfdisk -d /dev/mmcblk0 | grep "/dev/mmcblk0p2" | cut -d ',' -f 1 | cut -d '=' -f 2 | awk '{$1=$1};1'`;

newSize=$((totalSize - p2Start));

sfdisk -d /dev/mmcblk0 > /tmp/DiskLayout;

sed -i -E "s//dev/mmcblk0p2.*size=[ ]*[0-9]+, type=83//dev/mmcblk0p2 : start= ${p2Start}, size= ${newSize}, type=83/" /tmp/DiskLayout;

sfdisk /dev/mmcblk0 --no-reread < /tmp/DiskLayout;

reboot

resize2fs /dev/mmcblk0p2

reboot


resize2fs output:



Filesystem at /dev/mmcblk0p2 is mounted on /;
on-line resizing required old_desc_blocks = 1, new_desc_blocks = 1 Performing an on-line resize of /dev/mmcblk0p2 to 1924096 (4k) blocks.


this is a part of a process for preparing sd in mass production, so it must be done dynamically using a split script parts










share|improve this question









New contributor




rami khawaly is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
















  • 1





    It looks like it should have worked... are you sure that resize2fs completed without errors? (no harm running it again)

    – Attie
    yesterday













  • No, seems ok. here is the output: Filesystem at /dev/mmcblk0p2 is mounted on /; on-line resizing required old_desc_blocks = 1, new_desc_blocks = 1 Performing an on-line resize of /dev/mmcblk0p2 to 1924096 (4k) blocks.

    – rami khawaly
    yesterday











  • 1924096 * 4096 = 7.3 GiB... which isn't 3.1 G or ~14.8 G... can you refresh your question with new output from df -h and fdisk -l?

    – Attie
    yesterday













  • just updated the output

    – rami khawaly
    yesterday











  • Things still don't add up... fdisk and resize2fs now agree, and df is the odd one out... are you sure you're interrogating the correct / same system? IP conflict or something weird?

    – Attie
    yesterday
















0












0








0








I did resizing of my disk partition (/dev/mmcblk0p2), but after the process is done, what i get is the following results:



df -h :



Filesystem      Size  Used Avail Use% Mounted on
/dev/mmcblk0p2 3.1G 3.1G 2.5M 100% /
devtmpfs 360M 0 360M 0% /dev
tmpfs 489M 4.0K 489M 1% /dev/shm
tmpfs 489M 26M 464M 6% /run
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 489M 0 489M 0% /sys/fs/cgroup
/dev/mmcblk0p1 40M 16M 25M 40% /boot
tmpfs 98M 0 98M 0% /run/user/0
tmpfs 98M 0 98M 0% /run/user/1000



and fdisk -l result is :



Disk /dev/mmcblk0: 7.4 GiB, 7948206080 bytes, 15523840 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
Disklabel type: dos
Disk identifier: 0x00000000

Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 49152 131071 81920 40M 83 Linux
/dev/mmcblk0p2 131072 15523839 15392768 7.3G 83 Linux



why in df i don't get the full size of /dev/mmcblk0p2 ???



resizing done by the following set of commands



totalSize=`sfdisk -l /dev/mmcblk0 | grep "Disk /dev/mmcblk0" | cut -d ' ' -f 7`;

p2Start=`sfdisk -d /dev/mmcblk0 | grep "/dev/mmcblk0p2" | cut -d ',' -f 1 | cut -d '=' -f 2 | awk '{$1=$1};1'`;

newSize=$((totalSize - p2Start));

sfdisk -d /dev/mmcblk0 > /tmp/DiskLayout;

sed -i -E "s//dev/mmcblk0p2.*size=[ ]*[0-9]+, type=83//dev/mmcblk0p2 : start= ${p2Start}, size= ${newSize}, type=83/" /tmp/DiskLayout;

sfdisk /dev/mmcblk0 --no-reread < /tmp/DiskLayout;

reboot

resize2fs /dev/mmcblk0p2

reboot


resize2fs output:



Filesystem at /dev/mmcblk0p2 is mounted on /;
on-line resizing required old_desc_blocks = 1, new_desc_blocks = 1 Performing an on-line resize of /dev/mmcblk0p2 to 1924096 (4k) blocks.


this is a part of a process for preparing sd in mass production, so it must be done dynamically using a split script parts










share|improve this question









New contributor




rami khawaly is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












I did resizing of my disk partition (/dev/mmcblk0p2), but after the process is done, what i get is the following results:



df -h :



Filesystem      Size  Used Avail Use% Mounted on
/dev/mmcblk0p2 3.1G 3.1G 2.5M 100% /
devtmpfs 360M 0 360M 0% /dev
tmpfs 489M 4.0K 489M 1% /dev/shm
tmpfs 489M 26M 464M 6% /run
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 489M 0 489M 0% /sys/fs/cgroup
/dev/mmcblk0p1 40M 16M 25M 40% /boot
tmpfs 98M 0 98M 0% /run/user/0
tmpfs 98M 0 98M 0% /run/user/1000



and fdisk -l result is :



Disk /dev/mmcblk0: 7.4 GiB, 7948206080 bytes, 15523840 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
Disklabel type: dos
Disk identifier: 0x00000000

Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 49152 131071 81920 40M 83 Linux
/dev/mmcblk0p2 131072 15523839 15392768 7.3G 83 Linux



why in df i don't get the full size of /dev/mmcblk0p2 ???



resizing done by the following set of commands



totalSize=`sfdisk -l /dev/mmcblk0 | grep "Disk /dev/mmcblk0" | cut -d ' ' -f 7`;

p2Start=`sfdisk -d /dev/mmcblk0 | grep "/dev/mmcblk0p2" | cut -d ',' -f 1 | cut -d '=' -f 2 | awk '{$1=$1};1'`;

newSize=$((totalSize - p2Start));

sfdisk -d /dev/mmcblk0 > /tmp/DiskLayout;

sed -i -E "s//dev/mmcblk0p2.*size=[ ]*[0-9]+, type=83//dev/mmcblk0p2 : start= ${p2Start}, size= ${newSize}, type=83/" /tmp/DiskLayout;

sfdisk /dev/mmcblk0 --no-reread < /tmp/DiskLayout;

reboot

resize2fs /dev/mmcblk0p2

reboot


resize2fs output:



Filesystem at /dev/mmcblk0p2 is mounted on /;
on-line resizing required old_desc_blocks = 1, new_desc_blocks = 1 Performing an on-line resize of /dev/mmcblk0p2 to 1924096 (4k) blocks.


this is a part of a process for preparing sd in mass production, so it must be done dynamically using a split script parts







linux ubuntu partitioning






share|improve this question









New contributor




rami khawaly is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




rami khawaly is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited yesterday







rami khawaly













New contributor




rami khawaly is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked yesterday









rami khawalyrami khawaly

11




11




New contributor




rami khawaly is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





rami khawaly is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






rami khawaly is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








  • 1





    It looks like it should have worked... are you sure that resize2fs completed without errors? (no harm running it again)

    – Attie
    yesterday













  • No, seems ok. here is the output: Filesystem at /dev/mmcblk0p2 is mounted on /; on-line resizing required old_desc_blocks = 1, new_desc_blocks = 1 Performing an on-line resize of /dev/mmcblk0p2 to 1924096 (4k) blocks.

    – rami khawaly
    yesterday











  • 1924096 * 4096 = 7.3 GiB... which isn't 3.1 G or ~14.8 G... can you refresh your question with new output from df -h and fdisk -l?

    – Attie
    yesterday













  • just updated the output

    – rami khawaly
    yesterday











  • Things still don't add up... fdisk and resize2fs now agree, and df is the odd one out... are you sure you're interrogating the correct / same system? IP conflict or something weird?

    – Attie
    yesterday
















  • 1





    It looks like it should have worked... are you sure that resize2fs completed without errors? (no harm running it again)

    – Attie
    yesterday













  • No, seems ok. here is the output: Filesystem at /dev/mmcblk0p2 is mounted on /; on-line resizing required old_desc_blocks = 1, new_desc_blocks = 1 Performing an on-line resize of /dev/mmcblk0p2 to 1924096 (4k) blocks.

    – rami khawaly
    yesterday











  • 1924096 * 4096 = 7.3 GiB... which isn't 3.1 G or ~14.8 G... can you refresh your question with new output from df -h and fdisk -l?

    – Attie
    yesterday













  • just updated the output

    – rami khawaly
    yesterday











  • Things still don't add up... fdisk and resize2fs now agree, and df is the odd one out... are you sure you're interrogating the correct / same system? IP conflict or something weird?

    – Attie
    yesterday










1




1





It looks like it should have worked... are you sure that resize2fs completed without errors? (no harm running it again)

– Attie
yesterday







It looks like it should have worked... are you sure that resize2fs completed without errors? (no harm running it again)

– Attie
yesterday















No, seems ok. here is the output: Filesystem at /dev/mmcblk0p2 is mounted on /; on-line resizing required old_desc_blocks = 1, new_desc_blocks = 1 Performing an on-line resize of /dev/mmcblk0p2 to 1924096 (4k) blocks.

– rami khawaly
yesterday





No, seems ok. here is the output: Filesystem at /dev/mmcblk0p2 is mounted on /; on-line resizing required old_desc_blocks = 1, new_desc_blocks = 1 Performing an on-line resize of /dev/mmcblk0p2 to 1924096 (4k) blocks.

– rami khawaly
yesterday













1924096 * 4096 = 7.3 GiB... which isn't 3.1 G or ~14.8 G... can you refresh your question with new output from df -h and fdisk -l?

– Attie
yesterday







1924096 * 4096 = 7.3 GiB... which isn't 3.1 G or ~14.8 G... can you refresh your question with new output from df -h and fdisk -l?

– Attie
yesterday















just updated the output

– rami khawaly
yesterday





just updated the output

– rami khawaly
yesterday













Things still don't add up... fdisk and resize2fs now agree, and df is the odd one out... are you sure you're interrogating the correct / same system? IP conflict or something weird?

– Attie
yesterday







Things still don't add up... fdisk and resize2fs now agree, and df is the odd one out... are you sure you're interrogating the correct / same system? IP conflict or something weird?

– Attie
yesterday












0






active

oldest

votes












Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
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: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
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
});


}
});






rami khawaly is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1424231%2fdifferent-results-between-df-fdisk-commands%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes








rami khawaly is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















rami khawaly is a new contributor. Be nice, and check out our Code of Conduct.













rami khawaly is a new contributor. Be nice, and check out our Code of Conduct.












rami khawaly is a new contributor. Be nice, and check out our Code of Conduct.
















Thanks for contributing an answer to Super User!


  • 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.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1424231%2fdifferent-results-between-df-fdisk-commands%23new-answer', 'question_page');
}
);

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







Popular posts from this blog

Why not use the yoke to control yaw, as well as pitch and roll? Announcing the arrival of...

Couldn't open a raw socket. Error: Permission denied (13) (nmap)Is it possible to run networking commands...

VNC viewer RFB protocol error: bad desktop size 0x0I Cannot Type the Key 'd' (lowercase) in VNC Viewer...