Tiny Core Linux

Tiny Core Base => TCB Q&A Forum => Topic started by: ost on October 12, 2011, 04:32:13 AM

Title: Wait between fdisk and mkfs
Post by: ost on October 12, 2011, 04:32:13 AM
Im making a script to partition an IDE/CF disk and it appears that there is a critical time between fdisk and mkfs where I have to wait for the core to reread the partition table, orelse the mkfs will fail.
Does anyone know how to wait until the core is done so I can continue with mkfs?
Title: Re: Wait between fdisk and mkfs
Post by: maro on October 12, 2011, 05:08:31 AM
Yep, I can confirm that I've run into exactly the same problem. What I did end up doing was to put a sync ; sleep 1 sequence between the 'fdisk' and the 'mkfs' command (as a 'sync' on it's own did not seem to be sufficient).

That might be a bit of a kludge as there is no proper check and there might be situations where one seconds could be not enough. But I really did not want to spend too much time in finding a proper solution, when a simple work-around appeared to do as well (at least in my case).
Title: Re: Wait between fdisk and mkfs
Post by: ost on October 14, 2011, 04:05:59 AM
It appears there is a similar problem between mkfs and mount. I doubt the sync does anything to these transitions. I bet sync only works on a mounted filesystem.
Title: Re: Wait between fdisk and mkfs
Post by: roberts on October 15, 2011, 01:15:51 AM
hdparm -z device is what I have used in the installation scripts.

See: hdparm --help
Title: Re: Wait between fdisk and mkfs
Post by: ost on October 17, 2011, 08:40:30 AM
Thanks, hdparm did the job between fdisk and mkfs :) Not sure if it does between mkfs and mount.. I guess it shouldn't...
Title: Re: Wait between fdisk and mkfs
Post by: rmrichesjr on October 24, 2011, 12:13:48 PM
hdparm -z device is what I have used in the installation scripts.

See: hdparm --help

Is that known to work with /dev/sd* and /dev/vd* (TinyCore running in a qemu/libvirt VM)?
Is it known whether a 'udevadm settle' is necessary afterward to ensure that udev has finished whatever it does with a new partition?

Thanks.