if [ `head --bytes=512 /dev/fd0 | sum | cut --fields=1 --delim=" " ` !=
"00000" ]; then echo "Floppy in drive" ; fi 

(sum does a checksum which I think is only zero if all the contents are
zero. You should only need to check the partition/boot sector I think -
I won't guarantee this code is correct though!!!)


  

Martin Visser, CISSP
Network and Security Consultant 
Consulting & Integration
Technology Solutions Group - HP Services

410 Concord Road
Rhodes NSW  2138
Australia 

Mobile: +61-411-254-513
Fax: +61-2-9022-1800     
E-mail: martin.visserAThp.com

This email (including any attachments) is intended only for the use of
the individual or entity named above and may contain information that is
confidential, proprietary or privileged. If you are not the intended
recipient, please notify HP immediately by return email and then delete
the email, destroy any printed copy and do not disclose or use the
information in it.


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of James Gray
Sent: Wednesday, 15 June 2005 4:30 PM
To: [email protected]
Subject: Re: [SLUG] is a floppy inserted ?

On Wed, 15 Jun 2005 01:54 pm, Voytek wrote:
> <quote who="James Gray">
>
> > On Wed, 15 Jun 2005 09:42 am, Voytek Eymont wrote:
> >> how do I asses %subject% (from remote acces)
> >
> > Assuming floppy access in /etc/fstab has the "user" option:
> > mount /dev/fd0
>
> thanks, James, Terry, Matthew
>
> # cat /etc/fstab
> ...snip...
> /dev/fd0                /mnt/floppy             auto
noauto,owner,kudzu
> 0 0
>
> # mount /dev/fd0
> mount: /dev/fd0 is not a valid block device
>
> so, the 'mount: /dev/fd0 is not a valid block device' tells me there 
> is no media in floppy drive, yes ?

Yes

> could it also signify unformatted floppy ?

Possibly - but you'd more likely get a message about invalid
super-block, wrong filesystem or too many mounted filesystems, etc.

> (I amd doing a kernel update, hence, rebooting the machine, hence, I'd

> like to make sure it will boot from the hardrive, not, an inserted 
> floppy, should there be one)

In that case try using "dd":

dd if=/dev/fd0 of=floppy.img

Then use a hex editor or "strings" to read floppy.img and see if you get
anything useful.  Of course, if the server boots from floppy before it
boots the hard drive, and there's *anything* in the floppy drive
(formatted/bootable or otherwise) then you're screwed.  If you don't
know, then wait until you can verify the floppy's status manually.

James
--
Dyslexia means never having to say that you're ysror.
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to