delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/04/29/06:35:51

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RCVD_NUMERIC_HELO,SPF_HELO_PASS,SPF_PASS
X-Spam-Check-By: sourceware.org
To: cygwin AT cygwin DOT com
From: Thorsten Kampe <thorsten AT thorstenkampe DOT de>
Subject: Re: [1.7] Question: running from a portable drive
Date: Wed, 29 Apr 2009 12:35:00 +0200
Lines: 39
Message-ID: <gt9ah0$3gm$1@ger.gmane.org>
References: <49F82640 DOT 1000401 AT bonhard DOT uklinux DOT net>
Mime-Version: 1.0
User-Agent: MicroPlanet-Gravity/2.71.11
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

* Fergus (Wed, 29 Apr 2009 11:04:48 +0100)
> I run both [1.5] and [1.7] off portable drives plugged into whatever 
> host machine I'm using. After what originally took a lot of messing 
> about involving DOS variables like %CD% and %CWD% and DOS startup batch 
> files, [1.5] is successfully mounted at each use and will run 
> successfully without needing to specify (or even know) the driveletter 
> that has been allocated by the host to the portable drive on which it is 
> installed.
> 
> With [1.7] things are different and at the moment I have an explicit 
> drive letter in my /etc/fstab which in full is:
> 
> m:/bin /usr/bin vfat binary 0 0
> m:/lib /usr/lib vfat binary 0 0
> none / cygdrive user,posix=0 0 0
> 
> and I take steps to ensure that the driveletter allocated by the host to 
> the portable drive on which [1.7] is installed is M:. This is fine on 
> "my" machines but is not always possible on others'.
> 
> Can I write /etc/fstab more generally so that [1.7], like [1.5], can be 
> made to run off a portable drive without needing to specify (or even 
> know) the driveletter allocated by the host to the portable drive?

Interesting one. I have exactly the same environment and will have the 
same problem when starting to use 1.7.

My solution was to determine the drive letter at run time (when plugging 
in the stick). I use the following to set up the mount table (from a 
batch file):
mount -fu %~d0\cygwin     /
mount -fu %~d0\cygwin/bin /usr/bin
mount -fu %~d0\cygwin/lib /usr/lib
mount -fu %temp           /tmp

In principle this should also work for 1.7 presuming that mount simply 
writes to fstab instead of the registry.

Thorsten


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

- Raw text -


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