From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mailout04.t-online.de (mailout04.t-online.de [194.25.134.18]) by sourceware.org (Postfix) with ESMTPS id 5FA163858D28 for ; Tue, 13 Sep 2022 17:23:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5FA163858D28 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=t-online.de Authentication-Results: sourceware.org; spf=none smtp.mailfrom=t-online.de Received: from fwd74.dcpf.telekom.de (fwd74.aul.t-online.de [10.223.144.100]) by mailout04.t-online.de (Postfix) with SMTP id CAABED42 for ; Tue, 13 Sep 2022 19:23:52 +0200 (CEST) Received: from [192.168.2.101] ([79.230.170.147]) by fwd74.t-online.de with (TLSv1.3:TLS_AES_256_GCM_SHA384 encrypted) esmtp id 1oY9dU-1PJIn20; Tue, 13 Sep 2022 19:23:48 +0200 Subject: Re: Smartctl issues in Cygwin with elevated terminal To: The Cygwin Mailing List References: <228fb395-f742-5d99-d108-f3394129d97e@hamishmb.com> From: Christian Franke Message-ID: Date: Tue, 13 Sep 2022 19:23:48 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 SeaMonkey/2.53.12 MIME-Version: 1.0 In-Reply-To: <228fb395-f742-5d99-d108-f3394129d97e@hamishmb.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-TOI-EXPURGATEID: 150726::1663089828-CA4B6B6F-82D50B95/0/0 CLEAN NORMAL X-TOI-MSGID: a6baf528-e476-4978-8336-e1c80d7dcfd6 X-Spam-Status: No, score=-3.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM,KAM_DMARC_STATUS,KAM_LAZY_DOMAIN_SECURITY,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hamish McIntyre-Bhatty wrote: > I recently noticed that smartctl only works when the Cygwin Terminal > isn't run as administrator - the opposite way round to Linux where you > need superuser privileges to access the disk. > > With Administrator privileges on Windows 11, I get: > > "Read Device Identity Failure Input/Output error" This likely happens because one of the tried pass-through I/O-controls returns an error code which does not mean "not implemented". This is a limitation or bug in the driver of the disk controller. For further diagnostics, try for example. 'smartctl -r ioctl,2 -i /dev/sda' > > But it continues to work fine as a normal user. When run without admin rights for a SATA device, smarctl may print: "Warning: Limited functionality due to missing admin rights" and then prints only limited device identify and SMART DATA information returned by IOCTL_STORAGE_QUERY_PROPERTY and IOCTL_STORAGE_PREDICT_FAILURE. Other functionality requires admin rights and a working pass-through I/O-control - try 'smartctl -x /dev/sda'. Please note that the above is not Cygwin specific as it applies to both (Cygwin and Mingw-w64) Windows builds of smartctl. Use this ML for related support requests: https://listi.jpberlin.de/mailman/listinfo/smartmontools-support > > Does anyone know why? In my case, this actually matters because I'm > not sure how to elevate and/or drop privileges in Cygwin, as sudo > doesn't work due to it not being Unixy underneath. To drop privileges, try 'cygdrop' tool from 'cygutils-extra' package. -- Regards, Christian