delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2013/01/08/16:24:41

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-3.2 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RP_MATCHES_RCVD
X-Spam-Check-By: sourceware.org
Message-ID: <50EC8E7F.4030606@etr-usa.com>
Date: Tue, 08 Jan 2013 14:24:15 -0700
From: Warren Young <warren AT etr-usa DOT com>
User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version: 1.0
To: Cygwin-L <cygwin AT cygwin DOT com>
Subject: Re: disk format question
References: <50EC265F DOT 2010507 AT mailme DOT ath DOT cx> <50EC37EA DOT 8000308 AT etr-usa DOT com> <50EC3D77 DOT 5080804 AT mailme DOT ath DOT cx>
In-Reply-To: <50EC3D77.5080804@mailme.ath.cx>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On 1/8/2013 08:38, bartels wrote:
> On 01/08/2013 04:14 PM, Warren Young wrote:
>> On 1/8/2013 06:59, bartels wrote:
>>>
>>> The windows format.com
>>
>> format.com hasn't existed since the DOS days.
>
> That may very well be true, but I have a friend called locate:

I *had* a friend called "which", but he didn't find it.

I have now unfriended him. ;)

>>> My question is this: which device in /dev do I use?
>>
>> According to [this][1] it's probably /dev/sdb.  But please do read
>> through what I pointed you to first, and check its applicability
>> carefully before attempting this.
>
> 'Probably' is not good enough when the goal is targeted destruction :)

In that case, you shouldn't be looking at /dev names anyway.  They're 
assigned in order of device discovery, so the device that gets called 
/dev/sdb or whatever depends on what happened before your code ran.

Actually, it's even worse than that.

In Disk Management, you can permanently assign a USB key a different 
drive letter than the default.  Now when you put it in, it appears 
somewhere other than code blindly hard-coded with a /dev name expects.

Or, put two USB keys in, one gets called F: (say) and the other G:. 
Remove both.  Now plug the second back in...it's still called G:! 
Hence, it gets a different /dev name.

If this were Linux, I'd suggest basing your script's logic on device or 
filesystem UUIDs, but I don't know how to do that under Cygwin.

> Does windows leave a trail when mounting?

Oh, doubtless there's something buried in the NT device namespace, 
mentioned in the document I pointed you to.  Maybe you could dump two 
copies of it and diff(1) them, and assume that the one line that appears 
in the output is the new device.  Ugh.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019