Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1517469 - bad --resize by fedora-arm-image-installer
Summary: bad --resize by fedora-arm-image-installer
Keywords:
Status: CLOSED DEFERRED
Alias: None
Product: Fedora
Classification: Fedora
Component: fedora-arm-installer
Version: 27
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Paul Whalen
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-11-25 18:15 UTC by John Reiser
Modified: 2017-11-29 09:39 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-11-29 09:39:25 UTC


Attachments (Terms of Use)

Description John Reiser 2017-11-25 18:15:48 UTC
Description of problem: Resizing to occupy the entire 32GB uSDHC card forgets to resize the Extended partition.  The uSDHC card will boot, but the filesystem will become trash soon.


Version-Release number of selected component (if applicable):
fedora-arm-installer-2.0-1.fc27.noarch


How reproducible: every time


Steps to Reproduce:
1. With a 32GB uSDHC card in /dev/sdf:
fedora-arm-image-installer --image=Fedora-Workstation--27-1.6.aarch64.raw.xz --target=rpi3 --media=/dev/sdf --selinux=OFF --norootpass --resizefs --addconsole
2. parted /dev/sdf; unit MiB; p
3.

Actual results:
=====================================================
= Selected Image:                                 
= Fedora-Workstation-27-1.6.aarch64.raw.xz
= Selected Media : /dev/sdf
= U-Boot Target : rpi3
= SELINUX = OFF
= Root Password will be removed.
= Root partition will be resized
= Console for rpi3 will be added.
=====================================================
 
*****************************************************
*****************************************************
******** WARNING! ALL DATA WILL BE DESTROYED ********
*****************************************************
*****************************************************
 
 Type 'YES' to proceed, anything else to exit now 
 
= Proceed? YES
= Writing: 
= Fedora-Workstation-27-1.6.aarch64.raw.xz 
= To: /dev/sdf ....
0+675709 records in
0+675709 records out
8589934592 bytes (8.6 GB, 8.0 GiB) copied, 673.524 s, 12.8 MB/s
= Writing image complete!
= Resizing /dev/sdf ....
Checking that no-one is using this disk right now ... OK

Disk /dev/sdf: 29 GiB, 31167873024 bytes, 60874752 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: 0x56cb2384

Old situation:

Device     Boot   Start      End  Sectors  Size Id Type
/dev/sdf1  *       2048   411647   409600  200M  6 FAT16
/dev/sdf2        411648  2508799  2097152    1G 83 Linux
/dev/sdf3       2508800  4188159  1679360  820M 82 Linux swap / Solaris
/dev/sdf4       4188160 16777215 12589056    6G  5 Extended
/dev/sdf5       4190208 16777215 12587008    6G 83 Linux

/dev/sdf5: 
New situation:
Disklabel type: dos
Disk identifier: 0x56cb2384

Device     Boot   Start      End  Sectors  Size Id Type
/dev/sdf1  *       2048   411647   409600  200M  6 FAT16
/dev/sdf2        411648  2508799  2097152    1G 83 Linux
/dev/sdf3       2508800  4188159  1679360  820M 82 Linux swap / Solaris
/dev/sdf4       4188160 16777215 12589056    6G  5 Extended
/dev/sdf5       4190208 60874751 56684544   27G 83 Linux

The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
Error: Can't have overlapping partitions.
e2fsck 1.43.5 (04-Aug-2017)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/sdf5: 148367/393984 files (0.2% non-contiguous), 1214045/1572864 blocks
resize2fs 1.43.5 (04-Aug-2017)
Resizing the filesystem on /dev/sdf5 to 7085568 (4k) blocks.
The filesystem on /dev/sdf5 is now 7085568 (4k) blocks long.

= Turning SELinux off ...
= Removing the root password.
= Raspberry Pi 3 Uboot is already in place, no changes needed.
= Adding console ttyS0,15200n8 to extlinux.conf ...
sed: can't read /tmp/boot/extlinux/extlinux.conf: No such file or directory

= Installation Complete! Insert into the rpi3 and boot.

# echo $?
0   ## "success" for fedora-arm-image-installer

# parted /dev/sdf
GNU Parted 3.2
Using /dev/sdf
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) unit MiB                                                         
(parted) p                                                                
Error: Can't have overlapping partitions.
Ignore/Cancel? i                                                          
Error: Can't have a logical partition outside of the extended partition on /dev/sdf.
Ignore/Cancel? i                                                          
Error: Can't have overlapping partitions.
Ignore/Cancel? i                                                          
Error: Can't have a logical partition outside of the extended partition on /dev/sdf.
Ignore/Cancel? i                                                          
Model:  Multi-Reader -3 (scsi)
Disk /dev/sdf: 29724MiB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start    End       Size      Type      File system     Flags
 1      1.00MiB  201MiB    200MiB    primary   fat16           boot
 2      201MiB   1225MiB   1024MiB   primary   ext4
 3      1225MiB  2045MiB   820MiB    primary   linux-swap(v1)
 4      2045MiB  8192MiB   6147MiB   extended
 5      2046MiB  29724MiB  27678MiB  logical   ext4

(parted)

=========================================================

Notice the complaints from parted.  Notice that the Extended partition #4 ends at 8192MiB which does not cover the ext4 partition #5 that goes all the way to 29724MiB.

Expected results: Extended partition #4 is a superset of ext4 partition #5.


Additional info:

Comment 1 John Reiser 2017-11-28 16:39:45 UTC
fedora-arm-installer-2.1-1.fc27.noarch.rpm evades the issue by refusing to resize.  The output contains a message 
   = Resizing /dev/sdc ....
   = NOTE: Manual partition resizing is required.

but it is not prominent.

Also, while the rpi3 does boot, there is no console login, not even after waiting 5 minutes.  The last messages on the console monitor are:
  [ OK ] Started GNOME Display Manager.
         Starting Hostname Service...
  [   81.617711] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0xC5E1

and there is no arrow pointer, and no response to mouse or keyboard.

Comment 2 Peter Robinson 2017-11-29 09:39:25 UTC
(In reply to John Reiser from comment #1)
> fedora-arm-installer-2.1-1.fc27.noarch.rpm evades the issue by refusing to
> resize.  The output contains a message 
>    = Resizing /dev/sdc ....
>    = NOTE: Manual partition resizing is required.

It's a known problem, we wanted to get rid of the terrible extended partitioning but there's a bug and there wasn't enough time in the F-27 to prioritise to get it fixed. It will be fixed in F-28.

Ultimately I want to use GPT but some platforms expect their SPL boot process to be right in the middle of the primary GPT table.

You can just as easily use gparted or some other tool to resize the partition post setup.

> Also, while the rpi3 does boot, there is no console login, not even after
> waiting 5 minutes.  The last messages on the console monitor are:
>   [ OK ] Started GNOME Display Manager.
>          Starting Hostname Service...
>   [   81.617711] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa
> 0xC5E1
> 
> and there is no arrow pointer, and no response to mouse or keyboard.

It does get there, gnome is a bit slow depending a lot on the storage and memory. GNOME is a bit resource intensive and there's work to help sort some of this out for F-28. If you want just a console use the minimal image. This is also not related to this bug.


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