* [gentoo-user] Balky mounting of external devices
@ 2011-10-22 0:03 Walter Dnes
2011-10-22 20:21 ` Neil Bothwick
0 siblings, 1 reply; 5+ messages in thread
From: Walter Dnes @ 2011-10-22 0:03 UTC (permalink / raw
To: Gentoo Users List
This has happened to me with a few different external devices (USB
keys, etc) on multiple computers, so it seems to be a generic problem.
Right now, I have an HTC Desire HD with the smae problem...
* Either hit {CTRL}{ALT}{F12} to switch to tty12 or else (as root) execute
"tail -f /var/log/messages"
* Attach a device to the PC's USB port, and you'll see a bunch of stuff
spewing out. In my case, the last 3 lines are...
Oct 7 20:50:23 localhost kernel: [114416.426175] scsi 26:0:0:0: Direct-Access HTC Android Phone 0100 PQ: 0 ANSI: 2
Oct 7 20:50:23 localhost kernel: [114416.426336] sd 26:0:0:0: Attached scsi generic sg3 type 0
Oct 7 20:50:23 localhost kernel: [114416.432119] sd 26:0:0:0: [sdc] Attached SCSI removable disk
* If I try mounting /dev/sdc1 (either as ordinary user or root), it's
not found
* "fdisk -l" doesn't even see /dev/sdc
***BUT***
* as root "fdisk /dev/sdc", and quit immediately
and now "fdisk -l" sees /dev/sdc, and regular user can mount it. Has
anyone seen this before... and more importantly, found a solution?
--
Walter Dnes <waltdnes@waltdnes.org>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [gentoo-user] Balky mounting of external devices
2011-10-22 0:03 [gentoo-user] Balky mounting of external devices Walter Dnes
@ 2011-10-22 20:21 ` Neil Bothwick
2011-10-23 3:38 ` [gentoo-user] [SOLVED] " Walter Dnes
0 siblings, 1 reply; 5+ messages in thread
From: Neil Bothwick @ 2011-10-22 20:21 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 1077 bytes --]
On Fri, 21 Oct 2011 20:03:21 -0400, Walter Dnes wrote:
> * Attach a device to the PC's USB port, and you'll see a bunch of stuff
> spewing out. In my case, the last 3 lines are...
>
> Oct 7 20:50:23 localhost kernel: [114416.426175] scsi 26:0:0:0:
> Direct-Access HTC Android Phone 0100 PQ: 0 ANSI: 2 Oct 7
> 20:50:23 localhost kernel: [114416.426336] sd 26:0:0:0: Attached scsi
> generic sg3 type 0 Oct 7 20:50:23 localhost kernel: [114416.432119] sd
> 26:0:0:0: [sdc] Attached SCSI removable disk
>
> * If I try mounting /dev/sdc1 (either as ordinary user or root), it's
> not found
> * "fdisk -l" doesn't even see /dev/sdc
This came up recently with a different subject. Your device does not have
a partition table, instead the filesystem occupies the whole device
(sometimes referred to as a "superfloppy" format). There's nothing wrong
with this, I have a couple of USB sticks like it, and my Nexus S is the
same.
Your automounter should still pick it up.
--
Neil Bothwick
Top Oxymorons Number 33: American history
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* [gentoo-user] [SOLVED] Balky mounting of external devices
2011-10-22 20:21 ` Neil Bothwick
@ 2011-10-23 3:38 ` Walter Dnes
2011-10-23 11:07 ` Neil Bothwick
0 siblings, 1 reply; 5+ messages in thread
From: Walter Dnes @ 2011-10-23 3:38 UTC (permalink / raw
To: gentoo-user
On Sat, Oct 22, 2011 at 09:21:50PM +0100, Neil Bothwick wrote
> This came up recently with a different subject. Your device does not have
> a partition table, instead the filesystem occupies the whole device
> (sometimes referred to as a "superfloppy" format). There's nothing wrong
> with this, I have a couple of USB sticks like it, and my Nexus S is the
> same.
>
> Your automounter should still pick it up.
I don't use an automounter. I like to be in control of what gets
mounted when. Thanks for the explanation. With it in mind I've finally
come up with a plan that works. In /etc/sudoers.d/001 I've included...
waltdnes i3 = (root) NOPASSWD: /sbin/fdisk -l /dev/sdc
And there's an entry for a vfat device in /etc/fstab for directory
/mnt/extc. The command "/sbin/fdisk -l /dev/sdc" seems to read in the
partition table into the system and things work from there on in. fdisk
only works as root, hence the sudo command. Here's a sample session...
===================================================================
waltdnes@i3 ~ $ mount /mnt/extc
mount: special device /dev/sdc1 does not exist
waltdnes@i3 ~ $ sudo /sbin/fdisk -l /dev/sdc
Disk /dev/sdc: 16.0 GB, 16012804096 bytes
256 heads, 63 sectors/track, 1939 cylinders, total 31275008 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Device Boot Start End Blocks Id System
/dev/sdc1 * 2048 31275007 15636480 c W95 FAT32 (LBA)
waltdnes@i3 ~ $ mount /mnt/extc
waltdnes@i3 ~ $
===================================================================
The mount after "sudo /sbin/fdisk -l /dev/sdc" is successful. So all
I need is a short script "~/bin/mntc" like so...
#!/bin/bash
sudo /sbin/fdisk -l /dev/sdc
mount /mnt/extc
--
Walter Dnes <waltdnes@waltdnes.org>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [gentoo-user] [SOLVED] Balky mounting of external devices
2011-10-23 3:38 ` [gentoo-user] [SOLVED] " Walter Dnes
@ 2011-10-23 11:07 ` Neil Bothwick
2011-10-25 0:40 ` Walter Dnes
0 siblings, 1 reply; 5+ messages in thread
From: Neil Bothwick @ 2011-10-23 11:07 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 2333 bytes --]
On Sat, 22 Oct 2011 23:38:45 -0400, Walter Dnes wrote:
> On Sat, Oct 22, 2011 at 09:21:50PM +0100, Neil Bothwick wrote
>
> > This came up recently with a different subject. Your device does not
> > have a partition table, instead the filesystem occupies the whole
> > device (sometimes referred to as a "superfloppy" format). There's
> > nothing wrong with this, I have a couple of USB sticks like it, and
> > my Nexus S is the same.
> >
> > Your automounter should still pick it up.
>
> I don't use an automounter. I like to be in control of what gets
> mounted when.
Then use an intelligent automounter, that only mounts things you want it
to and lets you make choices about the rest :)
> Thanks for the explanation. With it in mind I've finally
> come up with a plan that works.
> In /etc/sudoers.d/001 I've included...
>
> waltdnes i3 = (root) NOPASSWD: /sbin/fdisk -l /dev/sdc
>
> And there's an entry for a vfat device in /etc/fstab for directory
> /mnt/extc. The command "/sbin/fdisk -l /dev/sdc" seems to read in the
> partition table into the system and things work from there on in. fdisk
> only works as root, hence the sudo command. Here's a sample session...
>
> ===================================================================
> waltdnes@i3 ~ $ mount /mnt/extc
> mount: special device /dev/sdc1 does not exist
> waltdnes@i3 ~ $ sudo /sbin/fdisk -l /dev/sdc
>
> Disk /dev/sdc: 16.0 GB, 16012804096 bytes
> 256 heads, 63 sectors/track, 1939 cylinders, total 31275008 sectors
> Units = sectors of 1 * 512 = 512 bytes
> Sector size (logical/physical): 512 bytes / 512 bytes
> I/O size (minimum/optimal): 512 bytes / 512 bytes
> Disk identifier: 0x00000000
>
> Device Boot Start End Blocks Id System
> /dev/sdc1 * 2048 31275007 15636480 c W95 FAT32 (LBA)
> waltdnes@i3 ~ $ mount /mnt/extc
> waltdnes@i3 ~ $
> ===================================================================
In that case, you have a different situation since there is clearly a
partition on the disk. The partition table may be slightly faulty, hence
the need for fdisk. Recreating the partition table with fdisk should fix
that permanently.
--
Neil Bothwick
Those who live by the sword get shot by those who don't.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [gentoo-user] [SOLVED] Balky mounting of external devices
2011-10-23 11:07 ` Neil Bothwick
@ 2011-10-25 0:40 ` Walter Dnes
0 siblings, 0 replies; 5+ messages in thread
From: Walter Dnes @ 2011-10-25 0:40 UTC (permalink / raw
To: gentoo-user
On Sun, Oct 23, 2011 at 12:07:23PM +0100, Neil Bothwick wrote
> In that case, you have a different situation since there is clearly a
> partition on the disk. The partition table may be slightly faulty, hence
> the need for fdisk. Recreating the partition table with fdisk should fix
> that permanently.
I thought about this, and decided not to. This is how the phone set
up the mini-SD card. If I change things, then I don't know how the
phone would react. The main concern is that it work properly in the
phone. I can work around its idiosyncrasies in linux whenever I need to
transfer photos off the phone, or other stuff to the phone.
--
Walter Dnes <waltdnes@waltdnes.org>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-10-25 0:41 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-22 0:03 [gentoo-user] Balky mounting of external devices Walter Dnes
2011-10-22 20:21 ` Neil Bothwick
2011-10-23 3:38 ` [gentoo-user] [SOLVED] " Walter Dnes
2011-10-23 11:07 ` Neil Bothwick
2011-10-25 0:40 ` Walter Dnes
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox