From owner-freebsd-scsi Wed Jan 17 9:47:25 2001 Delivered-To: freebsd-scsi@freebsd.org Received: from panzer.kdm.org (panzer.kdm.org [216.160.178.169]) by hub.freebsd.org (Postfix) with ESMTP id BBFC237B401 for ; Wed, 17 Jan 2001 09:47:00 -0800 (PST) Received: (from ken@localhost) by panzer.kdm.org (8.9.3/8.9.1) id KAA17475; Wed, 17 Jan 2001 10:44:37 -0700 (MST) (envelope-from ken) Date: Wed, 17 Jan 2001 10:44:37 -0700 From: "Kenneth D. Merry" To: clefevre@poboxes.com Cc: freebsd-scsi@FreeBSD.ORG Subject: Re: SCSI suspend/resume Message-ID: <20010117104437.B17373@panzer.kdm.org> References: <20010112211218.A32720@panzer.kdm.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2i In-Reply-To: ; from clefevre@citeweb.net on Wed, Jan 17, 2001 at 05:18:45AM +0100 Sender: owner-freebsd-scsi@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On Wed, Jan 17, 2001 at 05:18:45 +0100, Cyrille Lefevre wrote: > "Kenneth D. Merry" writes: > > sorry for the late answer, but I can't "spin down" my drives until now. > > > As soon as you try to access the drive, the SCSI subsystem will spin it > > back up. You can also spin a drive up with camcontrol: > > > > camcontrol start da0 > > yes, but those thing cannot be made automatically by the kernel as this > is done for IDE devices. Justin says that the apm code makes a BIOS call, and that the BIOS knows how to spin down an IDE disk. It doesn't know how to spin down a SCSI disk, though. So that's why apm -Z doesn't spin down your SCSI disk. > > > while EDI devices maybe suspended/resumed through apm -z... > > > > EDI devices? What are those? > > typo, read IDE. > > what do I mean is... on zzz (apm -Z), IDE drives are slept and waiked > u[ automatically by the kernel. and it seems there is no equivalent > way to do this for SCSI devices. try the following sequence : > > # grep /disk[12] /etc/fstab > /dev/ad0s1a /disk1 ufs rw 1 2 > /dev/da1s1a /disk2 ufs rw 1 2 > # df > Filesystem 1K-blocks Used Avail Capacity Mounted on > /dev/da0s1a 1904559 1720449 31746 98% / > /dev/ad0s1a 1904559 1655671 96524 94% /disk1 > /dev/da1s1a 2031922 1872260 -2891 100% /disk2 > (yes, I know, I'm almost full :) > # umount /disk1 > # umount /disk2 > # zzz > (you heard that disk1 is spinning down, but not disk2, so) > # camcontrol stop da1 > # mount /disk1 > (no problem, disk1 is waiked up and mounted) > # mount /disk2 > (oops) > Jan 17 05:01:57 gits /kernel: (da1:sym0:0:4:0): . CDB: 8 0 0 0 1 0 > Jan 17 05:01:57 gits /kernel: (da1:sym0:0:4:0): NOT READY asc:4,2 > Jan 17 05:01:57 gits /kernel: (da1:sym0:0:4:0): field replaceable unit: 2 > Jan 17 05:01:57 gits /kernel: da1: reading primary partition table: error reading fsbn 0 > Jan 17 05:09:40 gits /kernel: (da1:sym0:0:4:0): . CDB: 8 0 0 0 1 0 I'm not sure why you're getting errors, that should work in theory...and it does work for me: # umount /mnt/usr # umount /mnt/var # umount /mnt # camcontrol stop da1 -v Unit stopped successfully # mount /dev/da1s1a /mnt # df Filesystem 1K-blocks Used Avail Capacity Mounted on /dev/da0s1a 158783 73406 72675 50% / /dev/da0s1f 7766844 3016956 4128541 42% /usr /dev/da0s1e 254063 2770 230968 1% /var procfs 4 4 0 100% /proc /dev/da1s1a 158783 62397 83684 43% /mnt For what it's worth, it looks like you've compiled out the sense strings and the CDB strings in your kernel. That makes it more difficult to debug problems. Your drive is spitting out the correct error code, though. (ASC 0x4, ASCQ 0x2 -- logical unit not ready, initializing command required) > # camcontrol stop da1 > Unit started successfully Umm, what's going on there? It should have said unit stopped sucessfully, since you issued a 'camcontrol stop'... > # mount /disk2 > (ok) > do you understand what I mean ? > > PS : don't do that if you have any swap space on an SCSI drive or you're dead. Right, because the swap code probably times out before the disk can spin back up. Ken -- Kenneth Merry ken@kdm.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-scsi" in the body of the message