Bug 120607 - mkswap refuses to make swap on disk device
mkswap refuses to make swap on disk device
Status: CLOSED WONTFIX
Product: Red Hat Linux
Classification: Retired
Component: util-linux (Show other bugs)
9
i386 Linux
medium Severity low
: ---
: ---
Assigned To: Elliot Lee
Ben Levenson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-04-11 18:51 EDT by Tom de Vries
Modified: 2007-04-18 13:05 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-05-26 19:02:14 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Tom de Vries 2004-04-11 18:51:58 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1)
Gecko/20030225

Description of problem:
I tried to make a swap device of my old hd, but mkswap
wouldn't let me.

Commenting out the else clause of the following code in mkswap.c let's
me create the swap device just as I want.

        /* Want a block device. Probably not /dev/hda or /dev/hdb. */
        if (!S_ISBLK(statbuf.st_mode))
                check=0;
        /*
        else if (statbuf.st_rdev == 0x0300 || statbuf.st_rdev == 0x0340)
                die(_("Will not try to make swapdevice on %s"));
        */
                                                                     
          

The commment in the code states the behaviour was intentional, however
it is implemented too restrictive. If will be good to have the check
as a safety precaution, but maybe the -f (force) switch could be used
to force the command anyway.



Version-Release number of selected component (if applicable):
util-linux-2.11y-9

How reproducible:
Always

Steps to Reproduce:
1. type mkswap /dev/hd<x>, where x is an installed hd without any
useful data
2.
3.
    

Actual Results:  [root@tjvries disk-utils]# mkswap /dev/hdb
mkswap: Will not try to make swapdevice on '%s'

Note: even the error message is wrong...

Expected Results:  [root@tjvries disk-utils]# ./mkswap /dev/hdb
Setting up swapspace version 1, size = 1624666 kB

This is the behaviour with my privately build and fixed
mkswap binary

Additional info:
Comment 1 Elliot Lee 2004-05-26 19:02:14 EDT
The solution is to make an hdb1 swap partition that includes the whole
disk space. It may waste a few K of space, but it will keep the kernel
and disk utils a lot happier. Hopefully losing a little space out of
1.5G won't hurt too much :)

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