* Changes made by fdisk not being written to disk (2.5-bk)
@ 2003-06-12 22:41 Eduardo Pereira Habkost
2003-06-12 22:48 ` Andrew Morton
0 siblings, 1 reply; 2+ messages in thread
From: Eduardo Pereira Habkost @ 2003-06-12 22:41 UTC (permalink / raw)
To: linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1026 bytes --]
I have a SMP machine with a IDE hard disk running 2.5-bk20030611.
Today I changed the partition table of the disk, using fdisk, and
noticed, after reboot, that the new partition table was not written to
the disk. Before rebooting, 'fdisk -l /dev/hda' shows the new partition
table, as if it were written.
I've made a few more tests, and even if I sync() a dozen of times
before rebooting (using /bin/sync and sysrq), the data is not written.
Even when I've waited about 20 minutes after changing the partition table,
before rebooting, the problem persisted.
Although, after changing fdisk to call fsync() before closing the device,
everything worked, the changes were written, and the new partition table
were on the disk, after rebooting.
I think that changing fdisk to use fsync() would be a Good Thing, but
I guess that sync() should have the data be written, anyway.
Am I missing something?
If there is any additional information I could give, please let me know.
Regards,
--
Eduardo
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Changes made by fdisk not being written to disk (2.5-bk)
2003-06-12 22:41 Changes made by fdisk not being written to disk (2.5-bk) Eduardo Pereira Habkost
@ 2003-06-12 22:48 ` Andrew Morton
0 siblings, 0 replies; 2+ messages in thread
From: Andrew Morton @ 2003-06-12 22:48 UTC (permalink / raw)
To: Eduardo Pereira Habkost; +Cc: linux-kernel
Eduardo Pereira Habkost <ehabkost@conectiva.com.br> wrote:
>
> Today I changed the partition table of the disk, using fdisk, and
> noticed, after reboot, that the new partition table was not written to
> the disk. Before rebooting, 'fdisk -l /dev/hda' shows the new partition
> table, as if it were written.
>
> I've made a few more tests, and even if I sync() a dozen of times
> before rebooting (using /bin/sync and sysrq), the data is not written.
> Even when I've waited about 20 minutes after changing the partition table,
> before rebooting, the problem persisted.
>
> Although, after changing fdisk to call fsync() before closing the device,
> everything worked, the changes were written, and the new partition table
> were on the disk, after rebooting.
argh, is this a plot?
It is some interaction between sync() and the presence of dirty data against
the ramdisk driver. You can work around it by not using the ramdisk driver,
by using `blockdev --flushbufs /dev/hdXX' or by using fsync, as you have
done.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-06-12 22:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-12 22:41 Changes made by fdisk not being written to disk (2.5-bk) Eduardo Pereira Habkost
2003-06-12 22:48 ` Andrew Morton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®