Re: setup_harddisk and softupdate

2006-12-09 Thread Holger Levsen
Hi,

On Friday 08 December 2006 23:44, Janning Vygen wrote:
 Or is there any truly reliable method to decide if softupdate run before

sure. take care of it in your hook:


if [ ! -e /var/log/fai/1st_softupdate ] ; then
touch /var/log/fai/1st_softupdate
/usr/lib/fai/sbin/setup_harddisks -X
fi


regards,
Holger


pgpQimOgf9lVa.pgp
Description: PGP signature


setup_harddisk and softupdate

2006-12-08 Thread Janning Vygen
Hi,

i am using FAI for a few servers only by calling softupdate as the servers are 
pre-installed already and i have no control over the boot sequence.

I have two disks, one is used and formatted for the pre-installed system, the 
second disk is unused.

Now i wrote a hook softupdate.CLASS to run setup_harddisk, which just calls

 /usr/lib/fai/sbin/setup_harddisks -X

My disk_config looks like this:

disk_config sdb
primary  /media/sdb15-  ; -c -j ext3 lazyformat
primary  /media/sdb25-  ; -c -j ext3 lazyformat
primary  /media/sdb35-  ; -c -j ext3 lazyformat

I dropped disk_config sda as this disk should not be touched at all.

Fine. But i am a little bit solicitous about my data. I would like to run the 
hook only the first time softupdate is called. But as i am runing softupdate 
i can't tell if it was called the first time on this server or a secondtime. 

Or is there any truly reliable method to decide if softupdate run before and 
therefore we won't call /usr/lib/fai/sbin/setup_harddisks?

Maybe i can check 
   -f /var/log/fai/FAI_CLASSES

Do you have any hints? What can go wrong? I don't want to loose my data. I 
want to be sure that my harddisk won't be formatted if it is already in use.

kind regards
janning