Bug 646157 - ValueError: invalid raid level descriptor linear
Summary: ValueError: invalid raid level descriptor linear
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: anaconda
Version: 14
Hardware: i386
OS: Linux
low
medium
Target Milestone: ---
Assignee: David Lehman
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: anaconda_trace_hash:e3ec366ad7805fb5b...
: 708289 743282 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-10-24 15:30 UTC by Roberto Ragusa
Modified: 2011-10-04 14:41 UTC (History)
5 users (show)

Fixed In Version: anaconda-16.16-1.fc16
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-08-31 02:31:55 UTC
Type: ---


Attachments (Terms of Use)
Attached traceback automatically from anaconda. (98.19 KB, text/plain)
2010-10-24 15:30 UTC, Roberto Ragusa
no flags Details

Description Roberto Ragusa 2010-10-24 15:30:05 UTC
The following was filed automatically by anaconda:
anaconda 14.22 exception report
Traceback (most recent call first):
  File "/usr/lib/python2.7/site-packages/pyanaconda/storage/devicelibs/mdraid.py", line 81, in raidLevel
    raise ValueError, "invalid raid level descriptor %s" % descriptor
  File "/usr/lib/python2.7/site-packages/pyanaconda/storage/devices.py", line 2503, in __init__
    self.level = mdraid.raidLevel(level)
  File "/usr/lib/python2.7/site-packages/pyanaconda/storage/devicetree.py", line 1659, in handleUdevMDMemberFormat
    exists=True)
  File "/usr/lib/python2.7/site-packages/pyanaconda/storage/devicetree.py", line 1837, in handleUdevDeviceFormat
    self.handleUdevMDMemberFormat(info, device)
  File "/usr/lib/python2.7/site-packages/pyanaconda/storage/devicetree.py", line 1310, in addUdevDevice
    self.handleUdevDeviceFormat(info, device)
  File "/usr/lib/python2.7/site-packages/pyanaconda/storage/devicetree.py", line 1965, in populate
    self.addUdevDevice(dev)
  File "/usr/lib/python2.7/site-packages/pyanaconda/storage/__init__.py", line 400, in reset
    self.devicetree.populate()
  File "/usr/lib/python2.7/site-packages/pyanaconda/storage/__init__.py", line 117, in storageInitialize
    storage.reset()
  File "/usr/lib/python2.7/site-packages/pyanaconda/dispatch.py", line 212, in moveStep
    rc = stepFunc(self.anaconda)
  File "/usr/lib/python2.7/site-packages/pyanaconda/dispatch.py", line 131, in gotoNext
    self.moveStep()
  File "/usr/lib/python2.7/site-packages/pyanaconda/text.py", line 525, in run
    anaconda.dispatch.gotoNext()
  File "/usr/bin/anaconda", line 901, in <module>
    anaconda.intf.run(anaconda)
ValueError: invalid raid level descriptor linear

Comment 1 Roberto Ragusa 2010-10-24 15:30:11 UTC
Created attachment 455346 [details]
Attached traceback automatically from anaconda.

Comment 2 Roberto Ragusa 2010-10-24 15:44:48 UTC
I downloaded the F14 RC1 i386 iso (3561752576 bytes) and tried to install on my Athlon XP2400+ with 512MiB. Anaconda reported an error while detecting the disks. It appears to be software RAID related, but there is no software RAID on this machine, just 4 old boring PATA disks. The machine has no CD and no DVD; installation was running from http.

The string "invalid raid level descriptor linear" has zero hits on Google, so I filed this bug.

With the debug option of the anaconda error message I can see that the code is totally unaware of the linear raid level.

Comment 3 Roberto Ragusa 2010-10-24 15:56:24 UTC
Tried adding noload=linear to the grub command, but the module was loaded anyway.
Tried a modprobe -r linear in tty2 before anaconda attempt to scan disks. The module was actually removed, but anaconda still failed. The module has not been reloaded by anaconda, it is still missing from lsmod after the failure.

I do not see how I can install.

Is this problem happening everywhere?
My machine has nothing unusual.

Comment 4 Roberto Ragusa 2010-10-24 17:17:14 UTC
Hmmm, I just noticed these lines in the anaconda trace.

17:19:24,906 INFO program: Running... mdadm --examine --brief /dev/sda
17:19:25,008 INFO program: ARRAY /dev/md2 UUID=4a70b2a9:d69586db:e72d3c55:23a7bceb

I remember that this drive has been used (unpartitioned) in a linear RAID, in one of its previous lives.
The array can't be assembled as the other piece is missing, but anaconda is still unable to understand what a linear RAID is.
It is now clear why my machine is triggering the bug, but the bug is still there.
Anaconda fails if any disk or partition has a linear superblock.
I suppose that LVM is the new fashion today, so this was not discovered by anyone until now.

This is how the drive is detected by mdadm (/dev/hda because run from an ancient Fedora partition):

this used to be a linear RAID in 2003-2004 :-)

# mdadm --examine /dev/hda
/dev/hda:
          Magic : a92b4efc
        Version : 00.90.00
           UUID : 4a70b2a9:d69586db:e72d3c55:23a7bceb
  Creation Time : Thu Jul  3 22:10:13 2003
     Raid Level : linear
   Raid Devices : 2
  Total Devices : 2
Preferred Minor : 2

    Update Time : Thu Feb 19 16:06:36 2004
          State : clean
 Active Devices : 2
Working Devices : 2
 Failed Devices : 0
  Spare Devices : 0
       Checksum : 56022c1b - correct
         Events : 0.64

       Rounding : 4K

      Number   Major   Minor   RaidDevice State
this     1      22       66        1      active sync

   0     0       3        9        0      active sync
   1     1      22       66        1      active sync

Comment 5 David Lehman 2010-10-25 18:56:40 UTC
It would have been a good idea to remove the raid signature from the disk when you stopped using it as part of a raid array. In the future, consider doing so.

Comment 6 Roberto Ragusa 2010-10-29 21:42:05 UTC
The raid signature is normally lost if you repartition the disk. In this case it survived because the entire disk was a raid component and the signature was beyond the last partition when the drive was then partitioned and used.

This drive has been partitioned years ago and has been successfully working for years with an older Fedora (FC5). Only now Anaconda tried to do something a little too smart, by catching raid signature everywhere (including unpartitioned device on a partitioned disk) and failing because the internal enumeration of raid modes misses one of them (maybe the oldest one?).

There is a bug for sure.
Or would you suggest that having the presence of a degraded (or complete) linear raid to crash anaconda is acceptable?

Comment 7 Chris Lumens 2011-05-27 19:34:00 UTC
*** Bug 708289 has been marked as a duplicate of this bug. ***

Comment 8 David Lehman 2011-05-27 21:50:23 UTC
(In reply to comment #6)
> The raid signature is normally lost if you repartition the disk. In this case
> it survived because the entire disk was a raid component and the signature was
> beyond the last partition when the drive was then partitioned and used.
> 
> This drive has been partitioned years ago and has been successfully working for
> years with an older Fedora (FC5). Only now Anaconda tried to do something a
> little too smart, by catching raid signature everywhere (including
> unpartitioned device on a partitioned disk) and failing because the internal
> enumeration of raid modes misses one of them (maybe the oldest one?).

RAID signatures can be anywhere. Are you implying that because we found the spurious signature that should have been removed from your drive we shouldn't have been looking there? If your array were in working order you would complain that we didn't look.

> 
> There is a bug for sure.
> Or would you suggest that having the presence of a degraded (or complete)
> linear raid to crash anaconda is acceptable?

We just don't have any handling for linear md devices. I'll either add the support (if it's simple enough to do) or add a dialog stating that we don't support that raid level.

Consider booting a recent fedora livecd and using the wipefs utility to remove the old md signature from your disk. We may add support for linear md but since you are the first user to report having tried since the release of F11 it is not a high priority.

Comment 9 Roberto Ragusa 2011-05-28 21:11:16 UTC
(In reply to comment #8)

> Are you implying that because we found the
> spurious signature that should have been removed from your drive we shouldn't
> have been looking there? If your array were in working order you would complain
> that we didn't look.

I'm not saying that you should have not looked.
I'm saying that you should have been able to handle an incomplete array (ignoring it, as the kernel does).
You may have also missed that if I had had the second part of the linear array you would still have crashed because the code don't know what a linear mode is.


> We just don't have any handling for linear md devices. I'll either add the
> support (if it's simple enough to do) or add a dialog stating that we don't
> support that raid level.

No handling is the bug. Having a dialog would still qualify as a bug, IMHO.
Do you think "we don't boot on Tuesdays, it's documented" would be reasonable?

> Consider booting a recent fedora livecd and using the wipefs utility to remove
> the old md signature from your disk. We may add support for linear md but since
> you are the first user to report having tried since the release of F11 it is
not a high priority.

Thank you for your kind suggestion, I wiped the signature 7 months ago.
How can you say I'm the only user to have tried it? I'm the only one cooperative enough to file a bug, instead of just concluding "Fedora is crap".
Rare bugs should receive more appreciation than evident showstoppers.
There was a time when this kind of bug reports were much better welcomed.
See this bug report from me:
  http://www.mail-archive.com/linux-raid@vger.kernel.org/msg00436.html
(kernel bug on _RAID linear_ promptly fixed just before release of 2.4.0)

Comment 10 David Lehman 2011-05-31 14:35:07 UTC
> Thank you for your kind suggestion, I wiped the signature 7 months ago.

Clearly your efforts to wipe the signature were unsuccessful. When the signature has been removed blkid will no longer identify the devices a raid member.

Comment 11 Roberto Ragusa 2011-05-31 15:27:33 UTC
>> Thank you for your kind suggestion, I wiped the signature 7 months ago.

> Clearly your efforts to wipe the signature were unsuccessful. When the
> signature has been removed blkid will no longer identify the devices a raid
> member.

What I meant is that I wiped the signature 7 months ago and solved the problem
with the installation.
This bug is here not to solve my specific problem with my disk, but to have
a fix in anaconda.

Comment 12 Michal Szymanski 2011-08-18 05:58:28 UTC
I have been just badly hit by this bug, trying to upgrade a CentOS 5.3 system to F14 (actually using Omega 14 remix live DVD, but I guess anaconda is just the same). The old system had a "linear" md raid spanning two partitions on two hard disks.
I have manually changed the other partitions to make more room for system, so I am now left w/o any system.
While I could understand that the support for linear md devices has been dropped (although I do not know why - I guess the current kernel has still support for plethora of many more obsolete devices), it is really a bug that the installer fails on it instead of just warning/ignoring. I could at least install the system on the remaining partitions and then think how to deal with the linear md device.

Comment 13 Michal Szymanski 2011-08-18 07:05:33 UTC
addendum: the 2.6.35.6-48.fc14.i686 kernel present on this Live DVD Omega 14 disk DOES HAVE "linear" personality in /proc/mdstat and sees the device. Why the installer fails, remains a mystery to me.

Comment 14 Roberto Ragusa 2011-08-18 14:12:47 UTC
(In reply to comment #13)
> addendum: the 2.6.35.6-48.fc14.i686 kernel present on this Live DVD Omega 14
> disk DOES HAVE "linear" personality in /proc/mdstat and sees the device. Why
> the installer fails, remains a mystery to me.

The installer fails because the code doesn't know that RAID linear (-1) exists.
See: (anaconda source code)

def isRaid(raid, raidlevel):
    """Return whether raidlevel is a valid descriptor of raid"""
    raid_descriptors = {RAID10: ("RAID10", "raid10", "10", 10),
                        RAID6: ("RAID6", "raid6", "6", 6),
                        RAID5: ("RAID5", "raid5", "5", 5),
                        RAID4: ("RAID4", "raid4", "4", 4),
                        RAID1: ("mirror", "RAID1", "raid1", "1", 1),
                        RAID0: ("stripe", "RAID0", "raid0", "0", 0)}

    if raid in raid_descriptors:
        return raidlevel in raid_descriptors[raid]
    else:
        raise ValueError, "invalid raid level %d" % raid

Comment 15 David Lehman 2011-08-18 15:04:07 UTC
The problem is that nobody has taken the time to add support for linear md to anaconda. There are now three known cases of people trying to use it in fedora. I know that 3 > 0 but this is not a very high priority.

If I can get some code together, can you guys test it for me? All you'll be doing is starting the installer and seeing if you can get to the partitioning screen with it correctly displaying your linear raid setup.

Comment 16 Michal Szymanski 2011-08-18 23:54:20 UTC
Sorry, I had to install the system anyway, so I booted System Rescue CD (which luckily did know the linear), dumped the data, wipefs-ed the RAID signatures and installed F14. So I do not have a test bench anymore.

Still, apart from the issue of supporting that particular device by the Fedora installer, I would like to stress once again that it seems to me seriously wrong that the whole installation process fails on such an error. After all, people do have dual-boot systems and the other OSes can have, at least in principle, devices, partitions, file systems totally unknown to current Linux. It was quite true not very long ago when Redhat-alike linuxes did not support NTFS or XFS files systems, at least not right-from-the-box. And yet, it was possible to install, provided there were enough "recognizable" space on the hard disk(s). Here, alike, the anaconda should just warn the user and continue w/o using the unknown device.

Comment 17 Roberto Ragusa 2011-08-19 12:43:56 UTC
(In reply to comment #15)
> If I can get some code together, can you guys test it for me? All you'll be
> doing is starting the installer and seeing if you can get to the partitioning
> screen with it correctly displaying your linear raid setup.

I can do it.
Indeed, everyone can. It is very simple to create a simple linear RAID in a KVM machine and boot the installer.
Anyway, I'm available to test a fix.

Comment 18 David Lehman 2011-08-23 20:37:33 UTC
I have pushed a patch that will prevent the traceback. You will still be unable to use your linear array during install. I have opened an RFE to track the work of adding support for linear md devices as bug 732761.

Comment 19 Fedora Update System 2011-08-30 19:52:15 UTC
anaconda-16.16-1.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/anaconda-16.16-1.fc16

Comment 20 Fedora Update System 2011-08-31 02:31:20 UTC
anaconda-16.16-1.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 21 Chris Lumens 2011-10-04 14:41:47 UTC
*** Bug 743282 has been marked as a duplicate of this bug. ***


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