Bug 88000 - swapon called before devlabel in rc.sysinit
swapon called before devlabel in rc.sysinit
Product: Red Hat Linux
Classification: Retired
Component: initscripts (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
Brock Organ
Depends On:
  Show dependency treegraph
Reported: 2003-04-04 09:54 EST by David Balažic
Modified: 2014-03-16 22:35 EDT (History)
2 users (show)

See Also:
Fixed In Version: FC3
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-09-30 14:42:48 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description David Balažic 2003-04-04 09:54:09 EST
Description of problem:

In /etc/rc.d/rc.sysinit , swapon is called before devlabel,
so swapon might try to use the wrong device file, in case the swap device file
is managed by devlabel ( recommended if you change the disk drives a lot )

Line 338 :
action $"Activating swap partitions: " swapon -a -e

Line 501 :
if [ -x /sbin/devlabel ]; then
        /sbin/devlabel restart

Line 662 :
# Now turn on swap in case we swap to files.
swapon -a
action $"Enabling swap space: " /bin/true

The second swapon will "catch" the devlabel managed swap device, but the fisrt
might still try to access a wrong one ( because the symlink has not yet been
updated by devlabel and points to the old, possibly wrong device )

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


How reproducible:

Steps to Reproduce:
1. setup a devlabel managed swap device :
  - mkswap /dev/hdxy ( for example hda1 )
  - devlabel add -d /dev/hda1 -s /dev/swap1
( /dev/swap1 is now a symlink to /dev/hda1 )
  - add /dev/swap1 into /etc/fstab
2. make your swap disk change its name ( change from master to slave , or place
on different channel ) , let's assume it was hda before and is hdc now
3. boot
Actual results:

The first swapon call will try to use /dev/hda1 ( the symlink still points to it )

Expected results:

devlabel is run before swapon and updates the symlink to point to /dev/hdc1.
swapon has no error.

Additional info:
Comment 1 Bill Nottingham 2005-09-30 14:42:48 EDT
Closing bugs on older, no longer supported, releases. Apologies for any lack of

devlabel has since been deprecated in favor of udev. Therefore, changes to
earlier release code probably won't be made, and I'm closing this.

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