Red Hat Bugzilla – Bug 533851
regression: partprobe stopped working
Last modified: 2010-12-03 12:49:30 EST
Description of problem:
In fedora 12 partprobe does not work. Also gparted and others have limited functionality because of this.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1.run partprobe as root
Warning: The kernel was unable to re-read the partition table on /dev/sda (Device or resource busy). This means Linux won't know anything about the modifications you made until you reboot. You should reboot your computer before doing anything with /dev/sda.
partition table re-read
I've checked prev version parted-1.8.8-17.fc11.x86_64 (installed temporarily with nodeps) and it works as expected
Actually, the old parted had a bug where it would not report failure to re-read
the partition table even when it did fail.
If you want to partition a disk, and not require a reboot afterwards, you must make sure all partitions of the disk are not used (so not mounted, nor used for swap or as part of a raid set or volume group).
Closing this as not as bug.
well, was it really a bug?
1)add new partition
With new version:
warning, new partition can't be used (there is no new /dev/sd?X)
With old version:
no warning, new partition can be used, neew /dev/sd?X
what's buggy on this behaviour?
(In reply to comment #2)
> well, was it really a bug?
> 1)add new partition
> With new version:
> warning, new partition can't be used (there is no new /dev/sd?X)
> With old version:
> no warning, new partition can be used, neew /dev/sd?X
> what's buggy on this behaviour?
The fact that the kernel return-ed an -EBUSY somewhere which was being completely ignored, this might happen to work in certain cases, but could lead to serious issues (think data loss) in other situations. So now we stop at the first EBUSY which is, without any doubt, the right thing to do.
how can this lead to data loss? afaik (yes, I don't know how this work :) ) after try to re-read partition table it can be a) better if the partition was re-read OR b) with no change if it faild. Right?
Also is it that better compared to "I've modified my partition, but it's ignored" because I didn't reboot my system?
If for example a partition which is in use is made smaller, and then in the free space a new partition is created.
The old code would get an ebusy when trying to tell the kernel about the changed
partition, happily continue and make the new one, after which we have overlapping partitions. Write some data to both, and chances are one write will overwrite the other.
Really, not checking errors is not a good idea in a partitioning tool, what you are seeing is a feature meant to protect *your* data.
I have another scenario, which I've just tried on F-12:
lets have disk with three partitions, one system, two for data, with currently using that system, so I can't umount it
I want to make second partition smaller and third partition bigger. I've moved all data to another disk for backup.
Lets say partitions are 20 GB for /, 20 GB data1, 20 GB data2
remove data1 and data2
create new data1 10 GB and new data2 30 GB (both unformated)
everything seems to work, there is just warning at the end (where all steps successfully completed) about limited access only
run mkfs.something with parameters you want
-> both partitions are formated as 20 GB (I doubt anyone really reads complete output of mkfs if there is no line starting with ERROR).
mount both partition and copy data back on them
reboot and.... surprise! :)
(missing superblock for data2 and some parts of data1, both of wrong size)
so I think with not working partprobe it's not much better than it was.
Resizing mounted partition is imho quite corner case of cutting the branch you sit on and afaik it was not working even in F-11.
Which part of the following message parted gave you:
"Warning: The kernel was unable to re-read the partition table on /dev/sda
(Device or resource busy). This means Linux won't know anything about the
modifications you made until you reboot. You should reboot your computer
before doing anything with /dev/sda."
Did you not understand ? Esp. carefully read the following part:
"you should reboot your computer before doing anything with /dev/sda."
This new behaviour is not a bug, it is a bug fix, upstream parted agrees with
me on this, and parted-2.0 does this out of the box without any Fedora added patches.
This is my last comment on this not a bug bug, if you cannot understand that catching errors is much much better then ignoring them (which happened to turn out al right in certain cases but not in all), then there is not much more I have to say.
(In reply to comment #7)
> Which part of the following message parted gave you:
> "Warning: The kernel was unable to re-read the partition table on /dev/sda
> (Device or resource busy). This means Linux won't know anything about the
> modifications you made until you reboot. You should reboot your computer
> before doing anything with /dev/sda."
> Did you not understand ?
funny, but I did not get this message. If you re-read my comment #6, I've used gparted, not parted.
"""The kernel is unable to re-read the partition tables on the following devices:
Because of this you will only have limited access to these devices. Unmount all mounted partitions on a device to get full access."""
Ok, I have limited access, there is nothing written about successfully finished tasks are going to destroy my data.
Yes, I agree ignoring errors is bad idea, but imo 50 % working is better than 0 %.
btw, (during my quick search) I was not able to find any bug against parted with complaining about "buggy partprobe caused data loss"
my last comment, lets stop talking, it seems both of us are stubborn :o)
Stubborn we are, but if you did not get the message I quoted, or something similar, then that is a BIG bug in gparted, so you would do good to file a bug against gparted.
Note to put in the gparted bug:
I think gparted upstream has this fixed, as they are using the new 2.0 parted, which has this behaviour too, and they grumbled a bit at first too.