Gentoo Archives: gentoo-user

From: Walter Dnes <waltdnes@××××××××.org>
To: gentoo-user@l.g.o
Subject: [gentoo-user] [SOLVED] Balky mounting of external devices
Date: Sun, 23 Oct 2011 03:39:48
Message-Id: 20111023033845.GA30216@waltdnes.org
In Reply to: Re: [gentoo-user] Balky mounting of external devices by Neil Bothwick
1 On Sat, Oct 22, 2011 at 09:21:50PM +0100, Neil Bothwick wrote
2
3 > This came up recently with a different subject. Your device does not have
4 > a partition table, instead the filesystem occupies the whole device
5 > (sometimes referred to as a "superfloppy" format). There's nothing wrong
6 > with this, I have a couple of USB sticks like it, and my Nexus S is the
7 > same.
8 >
9 > Your automounter should still pick it up.
10
11 I don't use an automounter. I like to be in control of what gets
12 mounted when. Thanks for the explanation. With it in mind I've finally
13 come up with a plan that works. In /etc/sudoers.d/001 I've included...
14
15 waltdnes i3 = (root) NOPASSWD: /sbin/fdisk -l /dev/sdc
16
17 And there's an entry for a vfat device in /etc/fstab for directory
18 /mnt/extc. The command "/sbin/fdisk -l /dev/sdc" seems to read in the
19 partition table into the system and things work from there on in. fdisk
20 only works as root, hence the sudo command. Here's a sample session...
21
22 ===================================================================
23 waltdnes@i3 ~ $ mount /mnt/extc
24 mount: special device /dev/sdc1 does not exist
25 waltdnes@i3 ~ $ sudo /sbin/fdisk -l /dev/sdc
26
27 Disk /dev/sdc: 16.0 GB, 16012804096 bytes
28 256 heads, 63 sectors/track, 1939 cylinders, total 31275008 sectors
29 Units = sectors of 1 * 512 = 512 bytes
30 Sector size (logical/physical): 512 bytes / 512 bytes
31 I/O size (minimum/optimal): 512 bytes / 512 bytes
32 Disk identifier: 0x00000000
33
34 Device Boot Start End Blocks Id System
35 /dev/sdc1 * 2048 31275007 15636480 c W95 FAT32 (LBA)
36 waltdnes@i3 ~ $ mount /mnt/extc
37 waltdnes@i3 ~ $
38 ===================================================================
39
40 The mount after "sudo /sbin/fdisk -l /dev/sdc" is successful. So all
41 I need is a short script "~/bin/mntc" like so...
42
43 #!/bin/bash
44 sudo /sbin/fdisk -l /dev/sdc
45 mount /mnt/extc
46
47 --
48 Walter Dnes <waltdnes@××××××××.org>

Replies

Subject Author
Re: [gentoo-user] [SOLVED] Balky mounting of external devices Neil Bothwick <neil@××××××××××.uk>