From: David Bolt on
On Wednesday 28 Oct 2009 19:11, while playing with a tin of spray paint,
VWWall painted this mural:

> David Bolt wrote:

<snip>

>> Not much. Give each file system a unique label and then you'll get to
>> see those that are mounted under "My Computer". You can do this using
>> tune2fs for ext2 and ext3 file systems[0]. Other file systems have
>> ways of doing this as well.
>>
> Strangely enough, openSUSE already has /dev/disk/by-label, which shows
> *all* partitions that have been given labels.

I've been using it for several releases, although it was an issue with
10.2[0] and having /var on a separate partition that moved me to using
labels for all my file systems. It made things much easier and means
that it doesn't matter if I change drive ordering. With the change in
11.1 to using /dev/disk/by-id/ in /boot/grub/device.map , this isn't as
big an issue.

> It shows my "PCLOS_root",
> which is the only one I labeled. It doesn't seem to use these entries
> for anything.

You can change /etc/fstab to specify mounting using the file system
labels. Gets around the issue of /dev/disk/by-id when cloning a file
system from a failing hard drive.

> Some distros default to labels if they find partition labels on the
> drive(s).

I'm not surprised. It seems that various methods were used when certain
changes were made that meant the drive order was no longer fixed. Some
distros use by-id, others use by-label, and I'm sure there'll be some
others that are using by-uuid

> A right click on these "names" allows mounting the partition, checking
> its properties, etc. just as "My Computer" in openSUSE does.
>>
>> [0] This might also work with ext4 but can't confirm or deny it as yet.
>>
> I haven't played with ext4 yet as my GRUB boot can't handle it without
> chain loading. Just the inode changes some distros make by default, if
> you let their install do the formatting, confuses legacy GRUB!

I don't know about that. The only system I have with ext4 is the 11.2
test system, and grub boots that properly.


[0] May have been 10.1, I don't remember for certain.

Regards,
David Bolt

--
Team Acorn: www.distributed.net OGR-NG @ ~100Mnodes RC5-72 @ ~1Mkeys/s
openSUSE 10.3 32b | openSUSE 11.0 32b | |
openSUSE 10.3 64b | openSUSE 11.0 64b | openSUSE 11.1 64b | openSUSE 11.2rc1
RISC OS 4.02 | RISC OS 3.11 | openSUSE 11.1 PPC | TOS 4.02
From: Marcel Bruinsma on
Am Mittwoch, 28. Oktober 2009 20:11, VWWall a écrit :

> Strangely enough, openSUSE already has /dev/disk/by-label,
> which shows *all* partitions that have been given labels.

Actually, only file system labels are in /dev/disk/by-label,
not the partition labels assigned upon creation with
parted. Partitions used as swap or raid member do
not show.

--
printf -v email $(echo \ 155 141 162 143 145 154 142 162 165 151 \
156 163 155 141 100 171 141 150 157 157 056 143 157 155|tr \ \\\\)
# Live every life as if it were your last! #
From: VWWall on
Marcel Bruinsma wrote:
> Am Mittwoch, 28. Oktober 2009 20:11, VWWall a écrit :
>
>> Strangely enough, openSUSE already has /dev/disk/by-label,
>> which shows *all* partitions that have been given labels.
>
> Actually, only file system labels are in /dev/disk/by-label,
> not the partition labels assigned upon creation with
> parted. Partitions used as swap or raid member do
> not show.
>
Those assigned partition numbers are shown at the end of entries in
/dev/disk/by-id and also in /dev/disk/by-path.

I used /sbin/e2label to label partition sda11 as "PCLOS_root".
It shows in /dev/disk/by-label as such.

I assume it defines, (and shows), labels actually written to the boot
record of the partition. These will show with blkid, as will the UUID.

--
Virg Wall

From: David Bolt on
On Thursday 29 Oct 2009 02:42, while playing with a tin of spray paint,
Marcel Bruinsma painted this mural:

> Am Mittwoch, 28. Oktober 2009 20:11, VWWall a écrit :
>
>> Strangely enough, openSUSE already has /dev/disk/by-label,
>> which shows *all* partitions that have been given labels.
>
> Actually, only file system labels are in /dev/disk/by-label,
> not the partition labels assigned upon creation with
> parted. Partitions used as swap

Yes they do:

davjam(a)moray:/usr/src/packages/SOURCES> ls -l /dev/disk/by-label
total 0
lrwxrwxrwx 1 root root 10 2009-10-24 21:46 500_boot -> ../../sdc1
lrwxrwxrwx 1 root root 10 2009-10-24 21:46 500_root -> ../../sdc5
lrwxrwxrwx 1 root root 10 2009-10-24 21:46 500_swap -> ../../sdc2
lrwxrwxrwx 1 root root 10 2009-10-24 21:46 drive-f -> ../../sda1
lrwxrwxrwx 1 root root 10 2009-10-24 21:46 DVD_temp -> ../../sdb5
lrwxrwxrwx 1 root root 10 2009-10-24 21:46 ISOs -> ../../sdb7
lrwxrwxrwx 1 root root 10 2009-10-24 21:46 music -> ../../sdb6
lrwxrwxrwx 1 root root 10 2009-10-24 21:46 photos -> ../../sdb1
davjam(a)moray:/usr/src/packages/SOURCES> file -s /dev/disk/by-label/500_swap
/dev/disk/by-label/500_swap: symbolic link to `../../sdc2'
davjam(a)moray:/usr/src/packages/SOURCES> file -s /dev/sdc2
/dev/sdc2: Linux/i386 swap file (new style) 1 (4K pages) size 1116516 pages Label 500_swap

And swapon and swapoff can use the label to enable or disable the swap
partitions[0] in just the same way as mount and umount works with other
file systems.

> or raid member do
> not show.

Don't know about that as I don't use a raid array.


[0] My swap partitions are enabled in this way, just like I use labels
to mount the other (non-LVM) file systems.

Regards,
David Bolt

--
Team Acorn: www.distributed.net OGR-NG @ ~100Mnodes RC5-72 @ ~1Mkeys/s
openSUSE 10.3 32b | openSUSE 11.0 32b | |
openSUSE 10.3 64b | openSUSE 11.0 64b | openSUSE 11.1 64b | openSUSE 11.2rc1
RISC OS 4.02 | RISC OS 3.11 | openSUSE 11.1 PPC | TOS 4.02
From: David Bolt on
On Thursday 29 Oct 2009 05:51, while playing with a tin of spray paint,
VWWall painted this mural:

> Marcel Bruinsma wrote:

>> Actually, only file system labels are in /dev/disk/by-label,
>> not the partition labels assigned upon creation with
>> parted.

Oh, I missed that part. Partitions don't have labels although they do
have types, e.g. 82 is for swap, 83 for a Linux file system, 8E for one
that's able to be a part of a logical volume.

> I assume it defines, (and shows), labels actually written to the boot
> record of the partition. These will show with blkid, as will the UUID.

The labels are stored inside the superblock of the file system, which
may or may not be the boot record (sector 0), and are of a variety of
lengths. Reiserfs and ext2/3 can have upto 16 character labels, and
will truncate a label any longer when creating the file system. XFS can
have upto 12 characters but will abort when creating a file system if
the given label is longer. JFS supports labels, but the maximum number
of characters for the label isn't specified in the man page.


Regards,
David Bolt

--
Team Acorn: www.distributed.net OGR-NG @ ~100Mnodes RC5-72 @ ~1Mkeys/s
openSUSE 10.3 32b | openSUSE 11.0 32b | |
openSUSE 10.3 64b | openSUSE 11.0 64b | openSUSE 11.1 64b | openSUSE 11.2rc1
RISC OS 4.02 | RISC OS 3.11 | openSUSE 11.1 PPC | TOS 4.02