Find the answer to your Linux question:
Results 1 to 5 of 5
Hello, I connected my Sony PRS-T1 to my computer using minicom. It works under android. The problem is when I mount a partition, the size it shows under df is ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Dec 2012
    Posts
    3

    Partition size when mounted is different from partition table


    Hello,

    I connected my Sony PRS-T1 to my computer using minicom. It works under android. The problem is when I mount a partition, the size it shows under df is different from the one specified in the partition table.
    I think the problems comes from the fact that everytime I try to write the partition table with fdisk, it says :
    "fdisk: WARNING: rereading partition table failed, kernel still uses old table: Device or resource busy".
    Anyone has an idea as to why this happens ?

    (I followed approximately the tutorial to resize the partitions found here : wiki.mobileread.com / wiki / PRST1_Repartitioning_Guide . Though I could not complete step 18 because I could not mount mmcblk2p9 in loop, so I just used dd like the other partitions.)

  2. #2
    Linux Engineer
    Join Date
    Apr 2012
    Location
    Virginia, USA
    Posts
    899
    df will show you file system size. File systems require some sort of structure, so there is a little overhead, which is while you'll see a difference.

    The fdisk warning message is telling you that it can't re-write the partition table because the device is busy. Unmount the drive in question, and use partprobe.

  3. #3
    Just Joined!
    Join Date
    Dec 2012
    Posts
    3
    Quote Originally Posted by mizzle View Post
    df will show you file system size. File systems require some sort of structure, so there is a little overhead, which is while you'll see a difference.


    The fdisk warning message is telling you that it can't re-write the partition table because the device is busy. Unmount the drive in question, and use partprobe.
    First, thank you so much for taking the time to answer me

    In fact the difference is so huge that it is not due to the structure. It is 498425856B on the partition table (486744 blocks) and 47590000B when mounted (47590 1-K blocks). It is confirmed because here is the output of fdisk -l :

    /dev/mmcblk2p1 801 1120 10240 83 Linux
    /dev/mmcblk2p2 1121 1440 10240 83 Linux
    /dev/mmcblk2p3 1441 28526 866752 5 Extended
    /dev/mmcblk2p4 28527 59776 1000000 83 Linux
    /dev/mmcblk2p5 1441 2453 32408 83 Linux
    /dev/mmcblk2p6 2454 6806 139288 83 Linux
    /dev/mmcblk2p7 6807 7127 10264 83 Linux
    /dev/mmcblk2p8 7128 8408 40984 83 Linux
    /dev/mmcblk2p9 8409 23619 486744 83 Linux
    /dev/mmcblk2p10 23620 28526 157016 83 Linux

    And though, when mounted, mmcblk2p10 is 99.6M and mmcblk2p10 is 46.5M, although, as you can see, in the partition table partition 10 is way smaller than partition 9.

    I'm not sure about unmounting the drive, because the second primary partition is mounted as / . Is it safe to unmount it ? Partprobe is not installed on the device.

  4. #4
    Linux Engineer
    Join Date
    Apr 2012
    Location
    Virginia, USA
    Posts
    899
    You can always reboot. The MBR is written, just the kernel hasn't read the new version and is operating off the older version.

    If you resize (grow) a partition, then make sure you run resize2fs to grow your file system to the partition size. This could explain the discrepancy you are seeing.

  5. #5
    Just Joined!
    Join Date
    Dec 2012
    Posts
    3
    Thank you so much mizzle. I already resolved my problem. It was due to dd which copied the img to the device, but made the device have the same size when mounted as the img, although the partition had been enlarged.
    I managed to mount -o loop the img and used cp to copy the files in the img to the actual partition. I do not know why mount -o loop did not work before and prevented me to do the job though.
    The MBR is fine and the partitions have the required size.
    I did not try resize2fs though but I keep that in mind if I am to partition a disk again.
    Have a nice day.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •