[Parted-maintainers] Bug#417073: parted: trouble growing an old ext2 partition

J S Bygott jsb_no_spm at jsbygott.fsnet.co.uk
Sun Apr 1 14:05:32 UTC 2007


Package: parted
Version: 1.7.1-3
Severity: normal

Parted says "You found a bug in GNU Parted!".

But even before it said that, a resize command seems to have failed silently.

I'm attaching a log file with details.  I'm going to leave the offending
partitions alone for a while, in case you get back to me for further details.

At the start of the logfile, we have
 5      7230MB  9377MB  2147MB  logical   ext2    /usr
 6      9377MB  10.2GB  806MB   logical   ext2    (old /var) to be deleted
 7      10.2GB  11.8GB  1612MB  logical   ext2    /home
 8      11.8GB  12.0GB  197MB   logical   ext2    (old /tmp) to be deleted

My plan was to delete the partitions currently numbered 6 and 8, and
grow /usr and /home to fill the new space.

As the logfile shows:
 - my first attempt to resize 5 failed silently (this seems bad!)

 - my second attempt gives a lot of warnings of the type:
        Warning: Block 786702 shouldn't have been marked (0, 1)!
   and then:
        Error: Attempt to read sectors -2--1 outside of partition on /dev/hda.
        Ignore/Cancel? c

 - when I cancelled, parted said that I'd found a bug, and then:
        Error: SEGV_MAPERR (Address not mapped to object)Aborted

Later by contrast, removing (the old) 8 and growing /home worked perfectly.

It seems to me that:

 - it's bad that the first resize failed *silently*

 - some documentation on what the warnings mean and whether they are
   safe to ignore would we welcome

Trying the same resize again gives the same errors.  For the time being, I'm
not going to try anything else with that partition and that free space, in
case you want some more information, a backtrace or something.

I can give more details of the partition's history:

(January 2000)
- win98SE installer used to make /dev/hda1; win98SE installed there
- slink installer used to make other partitions
- only further change in seven years was updating the swap-partition type

(March 2007)
- booted testing etch from /dev/hdb

- dumped the disk layout with "sfdisk -d"
  (for clarity, I've added another column to show the normal mount points)

	# partition table of /dev/hda
	unit: sectors

	/dev/hda1 : start=       63, size= 13349952, Id= b
	/dev/hda2 : start= 13350015, size=   257040, Id=83, bootable    /
	/dev/hda3 : start= 13607055, size= 13092975, Id= 5
	/dev/hda4 : start=        0, size=        0, Id= 0
	/dev/hda5 : start= 13607118, size=   256977, Id=82              swap
	/dev/hda6 : start= 13864158, size=   256977, Id=82              swap
	/dev/hda7 : start= 14121198, size=  4192902, Id=83              /usr
	/dev/hda8 : start= 18314163, size=  1574307, Id=83              /var
	/dev/hda9 : start= 19888533, size=  3148677, Id=83              /home
	/dev/hda10: start= 23037273, size=  3662757, Id=83              /tmp

- used parted 1.7.1-3 from testing to make successful changes to /dev/hda
  as follows:

    - rm 6 (old-style 128MB swap partition for kernel < 2.1.xxx)
    - rm 5 (old-style 128MB swap partition for kernel < 2.1.xxx)
    - resize 3 7230 13670 (shrink extended partition now that swap is gone)
    - resize 2 6834 7033 (grow root partition by 50%)
    - mkpartfs primary linux-swap 7033 7230 (single bigger swap, ~192MB)

- new output from "sfdisk -d"
	# partition table of /dev/hda
	unit: sectors

	/dev/hda1 : start=       63, size= 13349952, Id= b
	/dev/hda2 : start= 13350015, size=   385560, Id=83, bootable   /
	/dev/hda3 : start= 14121135, size= 12578895, Id= 5
	/dev/hda4 : start= 13735575, size=   385560, Id=82             swap
	/dev/hda5 : start= 14121198, size=  4192902, Id=83             /usr
	/dev/hda6 : start= 18314163, size=  1574307, Id=83             /var
	/dev/hda7 : start= 19888533, size=  3148677, Id=83             /home
	/dev/hda8 : start= 23037273, size=  3662757, Id=83             /tmp

- used parted 1.7.1-3 to make more changes as follows:

    - resize 8 23037273s 23422769s (down to size by which /home will grow)
    - mkpart logical ext2 23422833s 25125659s (this will be the new /var)
    - cp 6 9 (paranoid: use cp (not move) so I can mount both for 'diff -R')
    - mkpart logical ext2 25125723s 26700029s (this will be the new /tmp)
    - cp 8 10 (paranoid again)

- rebooted; did my paranoid checks; ready to erase the old partitions
- rm 6 (the old /var), see logfile
- failure to grow /usr (the reason for this bugreport)
- rm 7 (the new minor number for the old /tmp)
- success with growing /home

-- System Information:
Debian Release: 4.0
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-3-486
Locale: LANG=en_GB, LC_CTYPE=en_GB (charmap=ISO-8859-1)

Versions of packages parted depends on:
ii  libc6                        2.3.6.ds1-8 GNU C Library: Shared libraries
ii  libncurses5                  5.5-5       Shared libraries for terminal hand
ii  libparted1.7-1               1.7.1-3     The GNU Parted disk partitioning s
ii  libreadline5                 5.2-2       GNU readline and history libraries

parted recommends no packages.

-- no debconf information
-------------- next part --------------
[Log of parted session, edited slightly for readability.]

Script started on Fri 30 Mar 2007 22:41:44 BST
wilma:~# parted /dev/hda
GNU Parted 1.7.1
Using /dev/hda
Welcome to GNU Parted! Type 'help' to view a list of commands.

                                                                          
(parted) print

Disk /dev/hda: 13.7GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type      File system  Flags
 1      32.3kB  6835MB  6835MB  primary   fat32             
 2      6835MB  7033MB  197MB   primary   ext2         boot 
 4      7033MB  7230MB  197MB   primary   linux-swap        
 3      7230MB  13.7GB  6440MB  extended                    
 5      7230MB  9377MB  2147MB  logical   ext2              
 6      9377MB  10.2GB  806MB   logical   ext2              
 7      10.2GB  11.8GB  1612MB  logical   ext2              
 8      11.8GB  12.0GB  197MB   logical   ext2              
 9      12.0GB  12.9GB  872MB   logical   ext2              
10      12.9GB  13.7GB  806MB   logical   ext2              


                                                                          
(parted) rm 6

                                                                          
(parted) print

Disk /dev/hda: 13.7GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type      File system  Flags
 1      32.3kB  6835MB  6835MB  primary   fat32             
 2      6835MB  7033MB  197MB   primary   ext2         boot 
 4      7033MB  7230MB  197MB   primary   linux-swap        
 3      7230MB  13.7GB  6440MB  extended                    
 5      7230MB  9377MB  2147MB  logical   ext2              
 6      10.2GB  11.8GB  1612MB  logical   ext2              
 7      11.8GB  12.0GB  197MB   logical   ext2              
 8      12.0GB  12.9GB  872MB   logical   ext2              
 9      12.9GB  13.7GB  806MB   logical   ext2              


                                                                          
(parted) resize 5

                                                                          
Start?  [7230MB]? 

                                                                          
End?  [9377MB]? 10.2GB

                                                                          
(parted) print

Disk /dev/hda: 13.7GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type      File system  Flags
 1      32.3kB  6835MB  6835MB  primary   fat32             
 2      6835MB  7033MB  197MB   primary   ext2         boot 
 4      7033MB  7230MB  197MB   primary   linux-swap        
 3      7230MB  13.7GB  6440MB  extended                    
 5      7230MB  9377MB  2147MB  logical   ext2              
 6      10.2GB  11.8GB  1612MB  logical   ext2              
 7      11.8GB  12.0GB  197MB   logical   ext2              
 8      12.0GB  12.9GB  872MB   logical   ext2              
 9      12.9GB  13.7GB  806MB   logical   ext2              


                                                                          
(parted) unit cyl

                                                                          
(parted) print

Disk /dev/hda: 1662cyl
Sector size (logical/physical): 512B/512B
BIOS cylinder,head,sector geometry: 1662,255,63.  Each cylinder is 8225kB.
Partition Table: msdos

Number  Start    End      Size    Type      File system  Flags
 1      0cyl     830cyl   830cyl  primary   fat32             
 2      831cyl   854cyl   24cyl   primary   ext2         boot 
 4      855cyl   878cyl   24cyl   primary   linux-swap        
 3      879cyl   1661cyl  783cyl  extended                    
 5      879cyl   1139cyl  260cyl  logical   ext2              
 6      1238cyl  1433cyl  195cyl  logical   ext2              
 7      1434cyl  1457cyl  23cyl   logical   ext2              
 8      1458cyl  1563cyl  105cyl  logical   ext2              
 9      1564cyl  1661cyl  97cyl   logical   ext2              


                                                                          
(parted) unit s

                                                                          
(parted) print

Disk /dev/hda: 26711999s
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start      End        Size       Type      File system  Flags
 1      63s        13350014s  13349952s  primary   fat32             
 2      13350015s  13735574s  385560s    primary   ext2         boot 
 4      13735575s  14121134s  385560s    primary   linux-swap        
 3      14121135s  26700029s  12578895s  extended                    
 5      14121198s  18314099s  4192902s   logical   ext2              
 6      19888533s  23037209s  3148677s   logical   ext2              
 7      23037273s  23422769s  385497s    logical   ext2              
 8      23422833s  25125659s  1702827s   logical   ext2              
 9      25125723s  26700029s  1574307s   logical   ext2              


                                                                          
(parted) resize 5

                                                                          
Start?  [14121198s]? 

                                                                          
End?  [18314099s]? 19888469s

                                                                          
Warning: Block 786702 shouldn't have been marked (0, 1)!

                                                                          
Warning: Block 786703 shouldn't have been marked (0, 1)!

                                                                          
Warning: Block 999695 shouldn't have been marked (0, 1)!

                                                                          
Warning: Block 1065230 shouldn't have been marked (0, 1)!

                                                                          
Warning: Block 1065231 shouldn't have been marked (0, 1)!

                                                                          
Warning: Block 1081613 shouldn't have been marked (0, 1)!

                                                                          
Warning: Block 1081614 shouldn't have been marked (0, 1)!

                                                                          
Warning: Block 1081615 shouldn't have been marked (0, 1)!

                                                                          
Warning: Block 1294605 shouldn't have been marked (0, 1)!

                                                                          
Warning: Block 1294606 shouldn't have been marked (0, 1)!

                                                                          
Warning: Block 1294607 shouldn't have been marked (0, 1)!

                                                                          
Warning: Block 1409293 shouldn't have been marked (0, 1)!

                                                                          
Warning: Block 1409294 shouldn't have been marked (0, 1)!

                                                                          
Warning: Block 1409295 shouldn't have been marked (0, 1)!

                                                                          
Warning: Block 1442061 shouldn't have been marked (0, 1)!

                                                                          
Warning: Block 1442062 shouldn't have been marked (0, 1)!

                                                                          
Warning: Block 1442063 shouldn't have been marked (0, 1)!

                                                                          
Warning: Block 1458445 shouldn't have been marked (0, 1)!

                                                                          
Warning: Block 1458446 shouldn't have been marked (0, 1)!

                                                                          
Warning: Block 1458447 shouldn't have been marked (0, 1)!

                                                                          
Warning: Block 1540365 shouldn't have been marked (0, 1)!

                                                                          
Warning: Block 1540366 shouldn't have been marked (0, 1)!

                                                                          
Warning: Block 1802509 shouldn't have been marked (0, 1)!

                                                                          
Warning: Block 1802510 shouldn't have been marked (0, 1)!

                                                                          
Error: Attempt to read sectors -2--1 outside of partition on /dev/hda.

                                                                          
Ignore/Cancel? c


You found a bug in GNU Parted! Here's what you have to do:

Don't panic! The bug has most likely not affected any of your data.
Help us to fix this bug by doing the following:

Check whether the bug has already been fixed by checking
the last version of GNU Parted that you can find at:

	http://ftp.gnu.org/gnu/parted/

Please check this version prior to bug reporting.

If this has not been fixed yet or if you don't know how to check,
please visit the GNU Parted website:

	http://www.gnu.org/software/parted

for further information.

Your report should contain the version of this release (1.7.1)
along with the error message below, the output of

	parted DEVICE unit co print unit s print

and additional information about your setup you consider important.

Error: SEGV_MAPERR (Address not mapped to object)Aborted
wilma:~# exit

Script done on Fri 30 Mar 2007 22:46:47 BST


More information about the Parted-maintainers mailing list