Bug 8853 - rescue lsparts partition sizes are incorrect
Summary: rescue lsparts partition sizes are incorrect
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: Installer (show other bugs)
Version: Cauldron
Hardware: x86_64 Linux
Priority: Normal normal
Target Milestone: ---
Assignee: Mageia tools maintainers
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-27 22:19 CET by Bit Twister
Modified: 2017-01-27 14:50 CET (History)
5 users (show)

See Also:
Source RPM: drakx-installer-rescue
CVE:
Status comment: 6_s2


Attachments

Description Bit Twister 2013-01-27 22:19:49 CET
Description of problem:

rescue lsparts partition sizes are incorrect. Values shown appear to be about half the partition size. Example. shows 9.7GB for 20GB partition.

Version-Release number of selected component (if applicable):


How reproducible: always


Steps to Reproduce:
1. boot media and enter rescue mode
2. lsparts
3. note partition size.
4. or try lsparts | less
   b
Comment 1 Manuel Hiebel 2013-12-05 21:40:47 CET
Changing version, it will be great to test if mga4 state is better (and add back to cauldron if it's still valid).

Version: Cauldron => 3

Bit Twister 2014-01-18 16:39:21 CET

CC: (none) => junknospam

Comment 2 Marja Van Waes 2015-03-31 16:05:15 CEST
Mageia 3 changed to end-of-life (EOL) status 4 months ago.
http://blog.mageia.org/en/2014/11/26/lets-say-goodbye-to-mageia-3/ 

Mageia 3 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of Mageia
please feel free to click on "Version" change it against that version of Mageia
and reopen this bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

--
The Mageia Bugsquad

Status: NEW => RESOLVED
Resolution: (none) => OLD

Comment 3 Bit Twister 2017-01-24 12:05:26 CET
$ grep caulul lsparts.txt
sda4:   20GB, fs ext4 (Journalised FS: ext4) [cauldron]
sdb4:   20GB, fs ext4 (Journalised FS: ext4) [cauldron_bkup]

$ df -h | grep -E "sda4|sdb4"
/dev/sda4        40G   18G   21G  47% /
/dev/sdb4        40G   18G   21G  46% /cauldron_bkup

gpt partitioned drives.

Status comment: (none) => 6_s2
Status: RESOLVED => REOPENED
Resolution: OLD => (none)
Summary: 3_b2: rescue lsparts partition sizes are incorrect => rescue lsparts partition sizes are incorrect

Comment 4 Marja Van Waes 2017-01-24 13:14:16 CET
(In reply to Bit Twister from comment #3)
> $ grep caulul lsparts.txt
> sda4:   20GB, fs ext4 (Journalised FS: ext4) [cauldron]
> sdb4:   20GB, fs ext4 (Journalised FS: ext4) [cauldron_bkup]
> 
> $ df -h | grep -E "sda4|sdb4"
> /dev/sda4        40G   18G   21G  47% /
> /dev/sdb4        40G   18G   21G  46% /cauldron_bkup
> 
> gpt partitioned drives.

Changing Version: to Cauldron

CC: (none) => marja11
Version: 3 => Cauldron
Assignee: bugsquad => mageiatools
Source RPM: (none) => drakx-installer-rescue

Comment 5 Thierry Vignaud 2017-01-27 14:21:23 CET
Looks like size records only half the sectors ({size} is expressed in sectors).
eg: 4191941 sectors according to lsparts vs 8383882 according to cfdisk
Diskdrake reports the right number of sectors

The issue is that lsparts is relying on fs::proc_partitions::read_raw(), which reads /proc/partition which reports size of devices in 1kb blocks instead of expected 512b sectors...

CC: (none) => pterjan, thierry.vignaud

Comment 6 Thierry Vignaud 2017-01-27 14:23:33 CET
The size is adjusted by *2 in read() but lsparts only used the lower level interface.
We could either move the size adjustment into read_raw() or also do it in lsparts.
The other users of read_raw() do not care about the {size} field
Comment 7 Thierry Vignaud 2017-01-27 14:29:09 CET
Fixed in git

Status: REOPENED => RESOLVED
Resolution: (none) => FIXED

Comment 8 Nicolas Lécureuil 2017-01-27 14:50:44 CET
Just for the reccord :

http://gitweb.mageia.org/software/drakx/commit/?
id=7cd51d36c05a66555b07a7fa850b21686ded2e1a

CC: (none) => mageia


Note You need to log in before you can comment on or make changes to this bug.