From owner-freebsd-questions Mon May 18 08:00:05 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id IAA23344 for freebsd-questions-outgoing; Mon, 18 May 1998 08:00:05 -0700 (PDT) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from cyclone.degnet.baynet.de (www.degnet.baynet.de [194.95.214.129]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id HAA23256 for ; Mon, 18 May 1998 07:59:56 -0700 (PDT) (envelope-from malte@webmore.com) Received: from neuron.webmore.com (unverified [194.95.214.165]) by cyclone.degnet.baynet.de (EMWAC SMTPRS 0.83) with SMTP id ; Mon, 18 May 1998 16:57:01 +0200 Received: from neuron.webmore.de (malte@webmore.com) by neuron.webmore.com (8.8.8/8.8.8) with ESMTP id QAA06870; Mon, 18 May 1998 16:57:58 +0200 (CEST) Message-ID: X-Mailer: XFMail 1.2 [p0] on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: Date: Mon, 18 May 1998 16:57:58 +0200 (CEST) Reply-To: malte@webmore.com From: Malte Lance To: Evren Yurtesen Subject: Re: cdrom mounting at boot Cc: questions@FreeBSD.ORG, kf7nn@kf7nn.com Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On 12-May-98 Evren Yurtesen wrote: > do you need to put your cdrom drive's mount place into fstab? > for example I added this command into rc.local file and it works > fine :) > /sbin/mount -t cd9660 /dev/wcd0a /usr/local/ftp/pub/cdrom What if there is an audio-cd in the drive, or no cd at all ? I have written a shell-script, that handles all this and much more and can recognize cd-roms and depending on the cd-rom found, issue a cdrom-specific command. The disadvantage is, it works only with scsi-cd-drives, since i did not find a command like scsi(8) for atapi-drives and i do not know, how to ioctl in userland. I append an excerpt of its features. The script is about 500 lines so i don't know if it would be offending to post it to the list. Therefor drop me an email and i'll mail you the script if you are interested. Malte Lance. Excerpt of features: # 0. No check if a cd-drive is present and no check if a present cd-drive # is a scsi-drive. # This script makes use of the scsi(8)-command, so your cd-drive should be # a scsi-drive # This script is just using /sbin/scsi /sbin/mount /bin/date /bin/sleep. # No userland-apps are called. This means, it could be started early in # the bootup-process, just after the final mount of / (before /usr gets # mounted) # 1. check if the cd-drive is "becoming ready". If yes, wait some time # (user-definable). # 2. check if there is a medium in the cd-drive # 3. if medium is present, check the first user-readable track for type # 4. if the track is a data-track, look if the cdrom could be found in the # cd-parameter-list # 5. if a matching entry is found, issue entry-specific command # # shell-arguments (all optional): # $1: timeout in sec. for rechecking [default 10] # $2: recheck-interval in sec. if rechecking [default 1] # $3: scsi-unit the cd-specific action-command should work on # [default /dev/cd0a] # $4: control-unit for scsi(8)-commands [default /dev/rcd0.ctl] # cd-parameter-list: # The cd-parameter-list is organized into cd-sets. Each cd-set has # set-specific and cd-specific identifier-strings defined by block-adress, # position in block, the string and string-length. For every cd in a cd-set # there is an action-command-string, that will be called, when the cd is # recognized. Have a look at the CD?_* list below. # For all FreeBSD-CD(-sets) i have found the following to be true: # at block 16 there are 3 strings that can be used to uniquely identify # the cd (all position-values are relative to start of block): # pos 1, length 5: "CD001" # pos 8, length 32: "FREEBSD" or "FreeBSD" # pos 40, length 32: "FBSD_222A" or "FBSD_222B" or "2.1.5-RELEASE-0E" or # "2.1.5-RELEASE-1D" or "FREEBSD210A" or "FREEBSD210B" # or ... # The command i used to find this entries is: # scsi -f /dev/rcd0.ctl -c "28 0:b3 1:b1 1:b1 0:b2 0:b1 v:b32 0 v:b16 0" \ # 0x10 0x01 -i 2048 - | hexdump -v -C | more # The current cd-parameter-list recognizes the following FreeBSD-sets: # FreeBSD-2.2.2 # FreeBSD-2.1.5 # FreeBSD-2.1.0 # FreeBSD-2.0.5 # FreeBSD-1.1 # > > +--------------------------------------------------------+ >| Name : Evren Yurtesen - yurtesen@ispro.net.tr | >| S-mail: Mithatpasa Cad. No:1079/13 35290 Guzelyali | >| Home:+90-232-2857604 Work:+90-232-2463992 Izmir/TURKEY | > +--------------------------------------------------------+ > > On Mon, 11 May 1998 kf7nn@kf7nn.com wrote: > >> finally broke down and bought a new cd-rom and now i want to mount it at >> boot >> time but i dont want the system to hang if there is no disk in the drive or >> an error occurs mounting it (like before the new one). >> >> previously i would get the famous "enter path for sh" and be in single user >> mode if the cd-rom didnt mount. >> >> so what can i do to my fstab file that would allow this, after taking >> out the noauto option of course. >> >> /etc/fstab >> >> # Device Mountpoint FStype Options Dump >> # Pass# >> /dev/wd0s1b none swap sw 0 0 >> /dev/wd0s1a / ufs rw 1 1 >> /dev/wd0s1f /usr ufs rw 2 2 >> /dev/wd0s1e /var ufs rw 2 2 >> /dev/wcd0c /cdrom cd9660 ro,noauto 0 0 >> /dev/wd2 /drive2 ufs rw 1 1 >> proc /proc procfs rw >> ---------------------------------- >> E-Mail: kf7nn@kf7nn.com >> Date: 11-May-98 >> Time: 18:13:43 >> >> This message was sent by XFMail >> ---------------------------------- >> >> To Unsubscribe: send mail to majordomo@FreeBSD.org >> with "unsubscribe freebsd-questions" in the body of the message >> > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message ---------------------------------- E-Mail: Malte Lance Date: 18-May-98 Time: 16:44:24 ---------------------------------- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message