From owner-freebsd-questions@freebsd.org Fri Jul 28 20:00:20 2017 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ECE50DCD69C for ; Fri, 28 Jul 2017 20:00:20 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mailrelay14.qsc.de (mailrelay14.qsc.de [212.99.163.154]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.antispameurope.com", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7161E6E7BC for ; Fri, 28 Jul 2017 20:00:19 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx01.qsc.de ([213.148.129.14]) by mailrelay14.qsc.de; Fri, 28 Jul 2017 22:00:17 +0200 Received: from r56.edvax.de (port-92-195-203-176.dynamic.qsc.de [92.195.203.176]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx01.qsc.de (Postfix) with ESMTPS id 1EC743CC3F; Fri, 28 Jul 2017 22:00:17 +0200 (CEST) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id v6SK0GDt002321; Fri, 28 Jul 2017 22:00:16 +0200 (CEST) (envelope-from freebsd@edvax.de) Date: Fri, 28 Jul 2017 22:00:16 +0200 From: Polytropon To: byrnejb@harte-lyne.ca Cc: freebsd-questions@freebsd.org Subject: Re: Unable to mount USB Flash memory created on CentOS Message-Id: <20170728220016.21aa7c83.freebsd@edvax.de> In-Reply-To: <32ee693f24a1725290b47822cfd8bc9e.squirrel@webmail.harte-lyne.ca> References: <20170728205144.c1fc18df.freebsd@edvax.de> <4a5c3fd942ff8566eefaaf9c990abba0.squirrel@webmail.harte-lyne.ca> <20170728212432.7be758bc.freebsd@edvax.de> <32ee693f24a1725290b47822cfd8bc9e.squirrel@webmail.harte-lyne.ca> Reply-To: Polytropon Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-cloud-security-sender: freebsd@edvax.de X-cloud-security-recipient: freebsd-questions@freebsd.org X-cloud-security-Virusscan: CLEAN X-cloud-security-disclaimer: This E-Mail was scanned by E-Mailservice on mailrelay14.qsc.de with 3CB1D684E4E X-cloud-security-connect: mx01.qsc.de[213.148.129.14], TLS=1, IP=213.148.129.14 X-cloud-security: scantime:.1379 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jul 2017 20:00:21 -0000 On Fri, 28 Jul 2017 15:37:05 -0400, James B. Byrne wrote: > > On Fri, July 28, 2017 15:24, Polytropon wrote: > >> > Is the USB stick (usually /dev/da0 or /dev/da0s1 or something > >> > like that) _really_ mounted? > >> > >> Not that I can see. That appears to be the essence of the problem. > > > > Can you _manually_ mount the USB stick? For example, with > > something like > > > > % mount -t ext2fs -o ro /dev/da0 /media/da0 > > > mount -t ext2fs -o ro /dev/da0 /media/da0 > mount: /media/da0: No such file or directory Okay, so the USB stick detaches by itself - as you said you did not remove it (mechanically) from the system. Does this happen after a certain time, of as soon as you try to mount from it? You can easily tell if you open an additional terminal and run the command % tail -F /var/log/message Now insert the USB stick again and see _when_ it detaches. It might help if you do this again without being logged in to a desktop environment, i. e., log out, and change to the text mode console. Then insert again, do nothing for some time (to see if the stick detaches after some delay), and then try to mount manually from another virtual terminal, observing the kernel messages (to see if the stick detaches when you try to mount). > > No matter if the file browser will automatically open a window for > > /media/da0 (in this example), you can check again the output of > > > > % mount -v | grep da0 > > > > # mount -v | grep da0 > # Not mounted at all. > > and of course > > > > % ls /media/da0 > > > > to see if the files you are expecting are really there. > > > > # ls /media/da0 > ls: /media/da0: No such file or directory > # ls /media/ > # No mountpoint has been created. As I said, it will be created by the automounter according to the device name, that's why it's totally okay that no entry is provided in /etc/fstab for this kind of removable media. > >> > Check what's on the USB stick, using > >> > > >> > % gpart show da0 > >> > > >> # gpart show da0 > >> => 63 122915265 da0 MBR (59G) > >> 63 8001 - free - (3.9M) > >> 8064 122907264 1 !12 [active] (59G) > > > > Hmmm... that looks really strange... check with "old-fashioned" > > fdisk again: > > > > % fdisk da0 > > # fdisk da0 > ******* Working on device /dev/da0 ******* > parameters extracted from in-core disklabel are: > cylinders=7651 heads=255 sectors/track=63 (16065 blks/cyl) > > Figures below won't work with BIOS for partitions not in cyl 1 > parameters to be used for BIOS calculations are: > cylinders=7651 heads=255 sectors/track=63 (16065 blks/cyl) > > Media sector size is 512 > Warning: BIOS sector numbering starts with sector 1 > Information from DOS bootblock is: > The data for partition 1 is: > sysid 12 (0x0c),(DOS or Windows 95 with 32 bit FAT (LBA)) > start 8064, size 122907264 (60013 Meg), flag 80 (active) > beg: cyl 1/ head 0/ sector 1; > end: cyl 905/ head 60/ sector 61 > The data for partition 2 is: > > The data for partition 3 is: > > The data for partition 4 is: > That isn't an ext2 file system... again, I'd like to guess that the partitioning data is damaged, which would at least explain the inability to mount, but not the detaching you've seen. > > Is there an ext2 partition? The output you presented looks like > > a situation where there's nothing the system can automatically > > detect and mount. > > Well, this exact usb stick was mounted and working up to the point > that I inserted a second one. I have moved files from and to the > device earlier today. Maybe a clean unmount (or detach?) has damaged essential data? > > (I don't have an ext2 USB stick at hand so I cannot check how > > the gpart and fdisk output should look like for a valid TOC with > > an ext2 partition.) > > > > Can you re-initialize the USB stick on the Linux system? Just in > > case partitioning data has been damaged... > > > > No, I cannot. The stick contains my backup of the critical data from > my original workstation that was dying and has since passed on. That's why it's important to use -o ro whenever you want to retrieve files from a backup media. After success, mounting -o rw again is possible (in case you want to delete the files you no longer need). > The > contents were moved to the device using rsync. This USB key was used > straight from a sealed package and I did not format it. And rsync relies on a mounted device, at least read-only. It seems that something has gone really wrong. If this has something to do with an additional USB stick being inserted... I can only guess... the automount magic of the desktop did something really stupid? Mounting all stuff read-write? Then detach? Hmmm... it's actually hard to tell what happened, but the result more or less clearly states that there is no ext2 partition anymore... After re-initialization of the USB stick, it should mount again. However, the surprising detach is still a mystery. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...