Tiny Core Linux
Tiny Core Base => TCB Q&A Forum => Topic started 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?
-
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).
-
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.
-
hdparm -z device is what I have used in the installation scripts.
See: hdparm --help
-
Thanks, hdparm did the job between fdisk and mkfs :) Not sure if it does between mkfs and mount.. I guess it shouldn't...
-
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.