lkml.org 
[lkml]   [2003]   [Jun]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Changes made by fdisk not being written to disk (2.5-bk)
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.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:36    [W:0.025 / U:1.508 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site