Bug 291391 - confusing label for swapspace
Summary: confusing label for swapspace
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: anaconda
Version: 8
Hardware: All
OS: Linux
medium
low
Target Milestone: ---
Assignee: Anaconda Maintenance Team
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-09-14 18:13 UTC by John Reiser
Modified: 2008-04-22 15:15 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2008-04-22 15:15:45 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description John Reiser 2007-09-14 18:13:04 UTC
Description of problem: A label such as "SWAP-sdc5" is applied to a
newly-formatted swap partition.  The last portion "sdc5" is based on anaconda's
enumeration of drives, which is often NOT the same as the enumeration used by
the installed system.  For instance, in the running system the partiion can be
sda5.  This causes needless confusion.


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


How reproducible: always


Steps to Reproduce:
1. Custom manual disk layout install on 3-drive system: 1 PATA, 2 SATA drives. 
The PATA drive and the last SATA drive are pre-partitioned, with partion 5 on
each drive having type 82 (Linux swap) but with no "SWAPSPACE2" magic number.
2. Select partition 5 on the PATA drive (pre-partitioned as type 82, but with no
"SWAPSPACE2" marking), and ask manual disk druid to format it as swap.  Anaconda
calls this /dev/sdc5.
3.
  
Actual results:  Label "SWAP-sdc5" is written to partition 5 of the PATA drive,
and "LABEL=SWAP-sdc5" is inserted in /etc/fstab designating swap space. 
"/dev/sda5", which is anaconda's name for the [unformatted] partition 5 on the
last SATA drive, is also written to /etc/fstab as swap space.  When booted into
the installed system, the drives are enumerated backwards compared to anaconda.
 So the unformatted partition 5 on the last SATA drive is now /dev/sdc5, while
the label "SWAP-sdc5" appears on the partition which is now called /dev/sda5. 
The system uses only /dev/sda5, the 5th partition on the PATA drive, as swap space.


Expected results: Label for swapspace should not depend on enumeration order.
Instead, use the SerialNo from "hdparm -i /dev/sdX".

Additional info:

Comment 1 Jeremy Katz 2007-09-18 01:42:35 UTC
The serial number is going to be way too long.  The label for swaps is limited
to 15 characters.

Comment 2 John Reiser 2007-09-18 03:13:12 UTC
Take the rightmost 9 characters (non-blank) of the serial number.  Pre-pend with
"SWAP-X" where X is the partition number [1-9a-f] of the drive.  Then check for
uniqueness among the other such numbers on drives that are currently visible. 
Adjust the 'X'  as necessary [move to a different set of 15 characters.] to make
it unique among the labels that are currently visible.

Serial numbers that I observe range from 10 characters for Seagate and Maxtor
drives to 16 characters for Hitachi drives.

Comment 3 Chris Lumens 2008-04-22 15:15:45 UTC
We should be using UUIDs for swap space on regular partitions now, so while they
are no longer very readable they should not be confusing.


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