From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id A5A36138247 for ; Fri, 3 Jan 2014 16:28:23 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 836A3E0A70; Fri, 3 Jan 2014 16:28:18 +0000 (UTC) Received: from mail-wg0-f53.google.com (mail-wg0-f53.google.com [74.125.82.53]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 60480E0A0B for ; Fri, 3 Jan 2014 16:28:17 +0000 (UTC) Received: by mail-wg0-f53.google.com with SMTP id k14so13472058wgh.8 for ; Fri, 03 Jan 2014 08:28:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:reply-to:to:subject:date:user-agent:references:in-reply-to :mime-version:content-type:content-transfer-encoding:message-id; bh=NVipQCfoe1Ga5jdzbuIRevODOLsr/6dgzTYMx5h8joY=; b=HnpTLoxANy3BBw+XEgVIcZotlMqyBJ2TtAvy30zpXNzLYsjrToBj0ksCGkim9LJzNl 38HWBj25l27HbPPBt/9g6mOQ697UbiyNnkKdk+9ZaU62NkYl10lDo+k7Kulej5b6ljkr 2NMFm0fJ/U4eCQiHIK1/ZuLtWLJyfJp5VRLJZ4MVoghD3ALnF+y6WUCy4IkB+gCGgGHr 4eCYHo2qEzFX6g9hkM/Cdy8n67kQvaRzDqakM/KPkzAio06znCYsHMkNjJk41YIKaWp6 IDNYTIaIDON3LYsWZbsXEN0UiOGLtu2U7FVNEKLKaM+oTRurrA4L544siru8kapEvRvf fEKg== X-Received: by 10.194.57.130 with SMTP id i2mr414038wjq.69.1388766495932; Fri, 03 Jan 2014 08:28:15 -0800 (PST) Received: from dell_xps.localnet (230.3.169.217.in-addr.arpa. [217.169.3.230]) by mx.google.com with ESMTPSA id bc5sm3278620wib.4.2014.01.03.08.28.14 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Jan 2014 08:28:14 -0800 (PST) From: Mick To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] USB power management Date: Fri, 3 Jan 2014 16:28:11 +0000 User-Agent: KMail/1.13.7 (Linux/3.10.17-gentoo; KDE/4.11.2; x86_64; ; ) References: <20140102171631.GA14893@thinkpad-gentoo-89r> In-Reply-To: <20140102171631.GA14893@thinkpad-gentoo-89r> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2785949.kS0naY50Yo"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <201401031628.12810.michaelkintzios@gmail.com> X-Archives-Salt: 0332d19b-dc5c-48cd-8b07-a26b359a1d95 X-Archives-Hash: e942e3a7d32faa5297b2922ce2c469fc --nextPart2785949.kS0naY50Yo Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Thursday 02 Jan 2014 17:16:32 Andrew Tselischev wrote: > Hello list, >=20 > Recently I came into possession of an external USB hard drive. The > user's manual (obviously) stated that I should always use "safe removal > function" prior to disconnecting the hard drive. I suspect the purpose > of this is to tell the device to properly park the heads and power down, > but I don't have any idea how to do that on linux. Are you sure of this, or is it just an assumption? I would think that the "safe removal" refers to unmounting the fs so that=20 nothing is writing to it at the moment you are unplugging it. If not it wi= ll=20 likely corrupt the filesystem. So use whichever method you used to mount i= t=20 to safely unmount it before you physically disconnect it from your PC. > I tried writing '3' to /sys/bus/usb/device/.../power/autosuspend and > 'auto' to /sys/.../power/control but this doesn't power down the drive. > I do hear the indicative "click" after 3 seconds (at least I think I do), > but the "PWR" led still stays on, /sys/.../power/runtime_status still > says "active" (instead of "suspended") and I can access the data on the > block device /dev/sdb, all of which suggests that the drive is still > powered on. >=20 > So, perhaps you could give me a tip on how to properly detach USB > drives or link me to an up-to-date information about the kernel's USB > subsystem. >=20 >=20 > I should mention that I'm not using any of the over-complicated DEs, > just the bare bones X server with awesomewm and a terminal emulator. >=20 > I'm currently running kernel version 3.12.6-gentoo with udev-208 and > udisks-2.1.1 So, you should be able to do something like: udisksctl unmount -b /dev/sdd1 (or whatever is your device recognised as) to be able to safely unmount it. When power is removed by physically unplu= gin=20 it the disk will stop spinning and the head will be parked. Also have a lo= ok=20 at 'man eject'. =2D-=20 Regards, Mick --nextPart2785949.kS0naY50Yo Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQEcBAABAgAGBQJSxuUcAAoJELAdA+zwE4Ye1ZwH/3dkO6p0+/VFnAr2G0fmijDy 1jXaDDLO+Kz/SanHSuhAys0/MtFZMgIaNrlt6qz+Hp0/bRXEYirCIYDzfxWuSSr0 fqNQMm7e7jitYvPlBU8jRhj+qVMcIbP/A1ABQTAVWbSlA1IbRoH9Zd3f7vqNLyOl 3cT3YVA1ha65RcNZCzsy+WVPQ7vUKIxX4BCiK8GSDs8toexENz+cY6Zs4w7tqbwg oVmlhHPZF/amyTD0AT29bIjAmUz/qa+NJt6O2VSGfVBVaz6JvTc2MY5jlwfAuS3n F1niYw8T0VNbotf6a83o5T56lE//5Elt6DxPSczICj1ftf702xYM5AGeMro+s3E= =Fs08 -----END PGP SIGNATURE----- --nextPart2785949.kS0naY50Yo--