Problems mounting by label



I am trying to set up labels on a USB HD so that I can mount it in the same place each time I connect it.

The short version is that from what I've done (which I will detail below) when I try to

$ sudo mount /dev/ufs/Back1s1 /Volumes/Back1
mount: /dev/ufs/Back1s1 : Invalid argument

While

$ sudo mount /dev/da4s1 /Volumes/Back1

does work.

Using the latter defeats the purpose however, since I want eventually to mount things to a different mount point depending on their label.

Here is more detail of what I've done so far. I'm running RELENG_7_0

One thing that I've noticed is that /dev/da4s1 and /dev/ufs/Back1s1 have different device numbers:

ls -l /dev/da4* /dev/ufs
crw-r----- 1 root operator 0, 121 Apr 10 03:57 /dev/da4
crw-r----- 1 root operator 0, 122 Apr 10 03:57 /dev/da4s1

/dev/ufs:
total 0
crw-r----- 1 root operator 0, 123 Apr 10 03:57 Back1
crw-r----- 1 root operator 0, 124 Apr 10 03:57 Back1s1

But that might not mean anything.

I first used fdisk to change the active slice to be of FreeBSD type (I'm not planning on using these disks for other systems.) Here is what fdisk currently reports

$ fdisk /dev/da4
******* Working on device /dev/da4 *******
parameters extracted from in-core disklabel are:
cylinders=9729 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=9729 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 165 (0xa5),(FreeBSD/NetBSD/386BSD)
start 16065, size 156280320 (76308 Meg), flag 80 (active)
beg: cyl 1/ head 0/ sector 1;
end: cyl 512/ head 254/ sector 63
The data for partition 2 is:
<UNUSED>
The data for partition 3 is:
<UNUSED>
The data for partition 4 is:
<UNUSED>

I also used glabel to try to get a label on it, but couldn't see how I could use the glabel information for mounting.

here is what glabel reports for the device

$ glabel dump /dev/da4s1
Metadata on /dev/da4s1:
Magic string: GEOM::LABEL
Metadata version: 2
Label: Backup 1

So not knowing how to use the glabel information for mounting I used the -L option to newfs when I created the USF2 filesystem on /dev/da4s1

$ tunefs -p /dev/da4s1
tunefs: ACLs: (-a) disabled
tunefs: MAC multilabel: (-l) disabled
tunefs: soft updates: (-n) disabled
tunefs: gjournal: (-J) disabled
tunefs: maximum blocks per file in a cylinder group: (-e) 2048
tunefs: average file size: (-f) 16384
tunefs: average number of files in a directory: (-s) 64
tunefs: minimum percentage of free space: (-m) 8%
tunefs: optimization preference: (-o) time
tunefs: volume label: (-L) Back1
[jeffrey@kreacher /dev/ufs]$

(oops, I probably should turn on ACLs for this, but that is another matter).

Any pointers to help in getting this slice mountable in the same place every time. I feel like I must be very close to how this should be done, but something is a bit off.

Cheers,

-j








--
Jeffrey Goldberg http://www.goldmark.org/jeff/

_______________________________________________
freebsd-questions@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: use of label in fstab
    ... label ublinux edited fstab to contain: ... I made another partition /dev/sda5 and used e2label to label it dyndata, ... On bootup now, the first partition mounts correctly, but the second gives ... ~# mount -L dyndata /dyntest ...
    (Ubuntu)
  • Re: Disk Label Problem
    ... The disks are different sizes. ... > partition and the third to mount at /usr then when writing the changes ... this generated an error that it couldn't write label. ...
    (freebsd-questions)
  • Re: use of label in fstab
    ... use of label in fstab ... > I made another partition /dev/sda5 and used e2label to label it dyndata, ... I don't generally mount by label & I don't use ext filesystems, ...
    (Ubuntu)
  • Re: automatically mounted filesysystems in /media
    ... the system automatically mounts the two filesystems as / ... To give a label to an ext2/3 partition, ... and the partition will appear as /media/USB_EXT at the next mount. ...
    (alt.os.linux.suse)
  • Re: I used "boot0cfg" and destroyed the MBR.All labels dissapear! (How I Fixed it)
    ... then you have to repeat the disklabel step ... f) I edited the partition table using fdisk. ... Thus I have created a big slice ad0s1. ... On the b label put in the offset the sectors size of the previous (a ...
    (freebsd-questions)