Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 13174 - LiveCD 1.4_rc2 fails to reread partition table after fdisk, cfdisk of sfdisk -R
Summary: LiveCD 1.4_rc2 fails to reread partition table after fdisk, cfdisk of sfdisk -R
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Release Media
Classification: Unclassified
Component: Everything (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Gentoo LiveCD Package Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-01-03 12:37 UTC by Dirk Steinberg
Modified: 2004-10-04 14:35 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Steinberg 2003-01-03 12:37:52 UTC
After changing the BIOS partition table with fdisk, cfdisk of sfdisk,
the re-read of the partition table by the kernel fails with error 16:
Device or resource busy.

A reboot is neccessary.

I did not have any partition mounted, of course.

Could this be related to EVMS somehow, ie. EVMS keeping the
disk open? I have done some EVMS configs on the disk before.

/dws
Comment 1 Daniel Robbins (RETIRED) gentoo-dev 2003-01-03 22:32:34 UTC
Afaik, this is a hardware limitation and is not related to Gentoo Linux per se.
Will leave open for a bit to see if anyone has any comments on this.
Comment 2 Dirk Steinberg 2003-01-04 06:14:48 UTC
hardware limitation??? I don't think so.

I am 100% positive for the non-EVMS case that when I repartition
a drive that currently has no open partitions, I do not
have to reboot to activate the new table.

There is a special IOTCL that is called by *fdisk:
From the sfdisk man page:

       -R     Only execute the BLKRRPART ioctl (to make the kernel re-read the
              partition  table).  This  can  be useful for checking in advance
              that the final BLKRRPART will be successful, and also  when  you
              changed  the  partition  table  `by hand' (e.g., using dd from a
              backup).  If the kernel complains (`device busy for revalidation
              (usage  =  2)')  then  something  still uses the device, and you
              still have to unmount some file system, or say swapoff  to  some
              swap partition.

dws@cray:pts/1 /cvs/linux-2.5-xfs/linux % grep BLKRRPART include/linux/fs.h 
#define BLKRRPART  _IO(0x12,95) /* re-read partition table */

drivers/block/ioctl.c:
        case BLKRRPART:
                return blkdev_reread_part(bdev);

static int blkdev_reread_part(struct block_device *bdev)
{
        struct gendisk *disk = bdev->bd_disk;
        int res;

        if (disk->minors == 1 || bdev != bdev->bd_contains)
                return -EINVAL;
        if (!capable(CAP_SYS_ADMIN))
                return -EACCES;
        if (down_trylock(&bdev->bd_sem))
                return -EBUSY;
        res = rescan_partitions(disk, bdev);
        up(&bdev->bd_sem);
        return res;
}

/dws
Comment 3 Daniel Robbins (RETIRED) gentoo-dev 2003-01-08 22:31:25 UTC
OK :) I'll check with the evms guys.
Comment 4 Daniel Robbins (RETIRED) gentoo-dev 2003-01-10 02:15:48 UTC
Assigning to our friendly neighborhood EVMS developer :)
Comment 5 Zbynek Winkler 2003-10-19 08:20:38 UTC
It happened to me too. I was installing Dell Latitude LS and repatitioning
with cfdisk. First I've deleted all patitions and then created boot, swap
and root partitions. I was not using EVMS. After exiting the cfdisk (no message
about reboot required) I tried to create the filesystems. However before
the repartitioning I had only hda1&2. Now the root was supposed to be hda3
but the mkreiserfs kept reporting some problem (don't remember what exactly
- something about nonexistent device). After running some more sessions of
fdisk/cfdisk I was somehow able to get going. Now I am emergin -u system...
Comment 6 Daniel Black (RETIRED) gentoo-dev 2004-10-02 07:15:57 UTC
Assigned to non-devs - reassigning so these may be noticed. 
Comment 7 Chris Gianelloni (RETIRED) gentoo-dev 2004-10-04 14:35:32 UTC
1.4 RC2?

Is this even an issue on anything recent?  Was it even an issue on 1.4 final?

REOPEN if this is still a problem on the 2004.2 release.