Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 26 Feb 2012 10:54:56 +0700
From:      Erich Dollansky <erichfreebsdlist@ovitrap.com>
To:        freebsd-stable@freebsd.org
Cc:        Scott Bennett <bennett@cs.niu.edu>
Subject:   Re: random problem with 8.3 from yesterday
Message-ID:  <201202261054.56403.erichfreebsdlist@ovitrap.com>
In-Reply-To: <201202251027.q1PARURH021975@mp.cs.niu.edu>
References:  <201202251027.q1PARURH021975@mp.cs.niu.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi,

On Saturday 25 February 2012 17:27:30 Scott Bennett wrote:
>      On Wed, 22 Feb 2012 13:34:36 +0700 Erich Dollansky
> <erich@alogreentechnologies.com> wrote:
> 
> >I got a new thumb drive which was FAT formatted. I use this script to change this:
> >
> >!/bin/tcsh
> >#
> ># This script format a thumb drive connected to USB as da0.
> >#
> >printf "You have to run this script as 'root' to succeed.\n"
> >printf "Warning this script will delete all your data from /dev/da0. Continue? > "
> >set Eingabe = $<
> >if ("$Eingabe" == "y") then
> >   printf "\nDeleting the device "
> >   dd if=/dev/zero of=/dev/da0 bs=1k count=1
> >   printf "\nWriting the BSD label "
> >   bsdlabel -Bw da0 auto
> 
>      Hmmm...so no MBR and no GPT either?  Just the bare device?  I guess
> I haven't tried that, so I don't know what that would do.

it works since years with all other and even with hard disks. Only the system disk has to be done 'properly'.
> 
> >
> >I then call manually
> >
> >tunefs -L NewDeviceName /dev/da0a
> 
>      Just out of curiosity, I'd like to know why you run tunefs manually,

Historical reasons. It is an old script and I never updated it.

> rather than using "-L NewDeviceName" on the newfs command, given that your
> script is clearing the physical device and then creating an empty file
> system.
> >
> >Either this call or the mount command does not work randomly.
> >
> >When I then try to mount the device on /dev/da0a it does not work always.
> 
>      What do you mean when you write "mount the device on /dev/da0a"?
> Normally one mounts a filesystem onto a "device", e.g.,

I mean the device connected to /dev/da0a just to make clear that I did not use /dev/da0.
> 
> or some similar thing.  Also, why do you refer to /dev/da0a at all if you
> labeled the file system?  The whole point of labeling the file system is
> supposed to be so that you can mount it independently of the physical
> device name, e.g.,

It is a chicken egg problem. As long as fstab is not updated with the name of the new device, it does not work the other way.
> 
> 	mount /dev/ufs/NewDeviceName /thumbfs
> 
> which allows you to have an entry in /etc/fstab for mounting the file
> system that doesn't need to be edited every time you reboot the system or
> move devices around.

I do the editing later. It is just a matter of work sequence.
> >
> >I do not know what this causes, I am only randomly able to reproduce it.
> >
> >It might be affected by removing the device or keeping it plugged in.
> 
>      Well, yes, that's what you label partitions/devices to avoid having
> to deal with manually, right?

Do not forget, that this step does not happen always.
> >
> >uname says:
> >
> >FreeBSD AMD620.ovitrap.com 8.3-PRERELEASE FreeBSD 8.3-PRERELEASE #28: Tue Feb 21 17:15:07 WIT 2012     erich@AMD620.ovitrap.com:/usr/obj/usr/src/sys/AsusAMD620  amd64
> >
> >dmesg says:
> >
> >ugen1.2: <vendor 0x1005> at usbus1
> >umass0: <vendor 0x1005 USB FLASH DRIVE, class 0/0, rev 2.00/1.00, addr 2> on usbus1
> >umass0:  SCSI over Bulk-Only; quirks = 0x4001
> >umass0:2:0:-1: Attached to scbus2
> >da0 at umass-sim0 bus 0 scbus2 target 0 lun 0
> >da0: < USB FLASH DRIVE PMAP> Removable Direct Access SCSI-0 device 
> >da0: 40.000MB/s transfers
> >da0: 15272MB (31277056 512 byte sectors: 255H 63S/T 1946C)
> >
> >It is not an urgent problem.
> >
>      It most likely is not a problem at all.  See
> 
> http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/geom-glabel.html#AEN27470
> 
It does not explain to me why the device could not be mounted.

I did not have this problem anymore since then. It might be the case that the problem only appears when the drive has a fresh file system or a new label.

I will check this later.

Erich



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201202261054.56403.erichfreebsdlist>