Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

blivet crashes if it cannot find partitions on a disk #288

Closed
lantw44 opened this issue Dec 1, 2015 · 7 comments
Closed

blivet crashes if it cannot find partitions on a disk #288

lantw44 opened this issue Dec 1, 2015 · 7 comments

Comments

@lantw44
Copy link

lantw44 commented Dec 1, 2015

I run list_devices.py included in the examples directory, but it crashes:

Traceback (most recent call last):
  File "list_devices.py", line 8, in <module>
    b.reset()             # detect system storage configuration
  File "blivet/blivet.py", line 286, in reset
    self.devicetree.populate(cleanup_only=cleanup_only)
  File "blivet/devicetree.py", line 344, in populate
    self._populator.populate(cleanup_only=cleanup_only)
  File "blivet/populator.py", line 1630, in populate
    self._populate()
  File "blivet/populator.py", line 1693, in _populate
    self.add_udev_device(dev)
  File "blivet/populator.py", line 728, in add_udev_device
    device = self.add_udev_partition_device(info)
  File "blivet/populator.py", line 452, in add_udev_partition_device
    raise cls(msg)
blivet.errors.DiskLabelScanError: failed to scan disk sdb

blivet-gui also crashes with the same problem. I already reported it on Red Hat Bugzilla, but I don't get any response there: https://bugzilla.redhat.com/show_bug.cgi?id=1237284

I test this problem with git master branch of blivet on Fedora 23. It seems it is this problem that causes Fedora and CentOS installers crash on my machine. Fedora 23 is installed on /dev/sda and the disk that causes crash is /dev/sdb.

It seems that blivet uses parted, but parted is unable to recognize my disk:

# parted /dev/sdb print
Model: ATA Hitachi HDP72505 (scsi)
Disk /dev/sdb: 500GB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Disk Flags: 

Number  Start  End    Size   File system  Flags
 1      0.00B  500GB  500GB  fat16

util-linux fdisk works fine:

fdisk -l /dev/sdb
Disk /dev/sdb: 465.8 GiB, 500107862016 bytes, 976773168 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: 0xa5b43cc2

Device     Boot     Start       End   Sectors   Size Id Type
/dev/sdb1              63   4192964   4192902     2G  6 FAT16
/dev/sdb2         4192965   8385929   4192965     2G 16 Hidden FAT16
/dev/sdb3  *      8385930 113258249 104872320    50G 17 Hidden HPFS/NTFS
/dev/sdb4       113258250 976773167 863514918 411.8G  5 Extended
/dev/sdb5       113258313 742404095 629145783   300G  7 HPFS/NTFS/exFAT
/dev/sdb6       742406144 847268099 104861956    50G a5 FreeBSD
/dev/sdb7       847268163 976773119 129504957  61.8G 8e Linux LVM

Linux is able to recognize it:

[    3.445850] scsi 1:0:0:0: Direct-Access     ATA      Hitachi HDP72505 A5CA PQ: 0 ANSI: 5
[    3.454309] sd 1:0:0:0: Attached scsi generic sg1 type 0
[    3.454350] sd 1:0:0:0: [sdb] 976773168 512-byte logical blocks: (500 GB/465 GiB)
[    3.454473] sd 1:0:0:0: [sdb] Write Protect is off
[    3.454474] sd 1:0:0:0: [sdb] Mode Sense: 00 3a 00 00
[    3.454510] sd 1:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    3.523217] usb 5-1.6: new high-speed USB device number 3 using ehci-pci
[    3.539450]  sdb: sdb1 sdb2 sdb3 sdb4 < sdb5 sdb6 sdb7 >
[    3.545237] sd 1:0:0:0: [sdb] Attached SCSI disk

lsblk also works fine:

$ lsblk /dev/sdb
NAME                   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sdb                      8:16   0 465.8G  0 disk 
├─sdb1                   8:17   0     2G  0 part 
├─sdb2                   8:18   0     2G  0 part 
├─sdb3                   8:19   0    50G  0 part 
├─sdb4                   8:20   0     1K  0 part 
├─sdb5                   8:21   0   300G  0 part /mnt/protected/DATA
├─sdb6                   8:22   0    50G  0 part 
└─sdb7                   8:23   0  61.8G  0 part 
  ├─wnnext-linuxrouter 253:0    0    10G  0 lvm  
  ├─wnnext-bsdrouter   253:1    0    10G  0 lvm  
  ├─wnnext-linuxserver 253:2    0     5G  0 lvm  
  ├─wnnext-bsdserver   253:3    0     5G  0 lvm  
  ├─wnnext-fedoraarm   253:4    0     7G  0 lvm  
  ├─wnnext-gentoo      253:5    0    16G  0 lvm  
  └─wnnext-fedoraaa64  253:6    0     7G  0 lvm  
@lantw44
Copy link
Author

lantw44 commented Dec 1, 2015

I think blivet should not crash even if it finds a possibly invalid disk configuration. Crashing the installer means I am not able to install Fedora.

@bcl
Copy link
Contributor

bcl commented Dec 3, 2015

That's odd. parted says you don't have a partition table, it thinks the device is a loopback FAT16 filesystem.

Could you open a bug against parted at https://bugzilla.redhat.com and include the details you have here as well as the first 62 sectors of your disk? eg. output from:

dd if=/dev/sdb of=first62.bin count=62

@lantw44
Copy link
Author

lantw44 commented Dec 3, 2015

I filed a bug here: https://bugzilla.redhat.com/show_bug.cgi?id=1288091

@bcl
Copy link
Contributor

bcl commented Dec 4, 2015

Explanation is here - https://bugzilla.redhat.com/show_bug.cgi?id=1288091#c1

Basically, parted can't handle this disk because of old FAT16 metadata on it.

@bcl bcl closed this as completed Dec 4, 2015
@vojtechtrefny
Copy link
Member

If think blivet should be still able to "work" even if it can't use/read one of the disks, we could hide it (or do the wipefs if user wants to) and allow changes on other disks.

@vojtechtrefny vojtechtrefny reopened this Dec 4, 2015
@vpodzime
Copy link
Contributor

vpodzime commented Dec 4, 2015

Agreed.

@dwlehman
Copy link
Contributor

This handling should be added to blivet-gui. It can catch UnusableConfigurationError and handle it however it wants. Blivet cannot make these decisions on its own and it does not have a user interface, so this is left to anaconda and blivet-gui.

If you want to ignore that disk completely, add it to ignored_disks before populating the DeviceTree.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants