Skip to contentSkip to conversation

labelling

DISCUSSION Helmut Hullen 4 participants 9 messages Nov 10, 2010 – Nov 11, 2010 Btrfs file system

lore
Share & tools
lore
#0 lore raw

Hallo, linux-btrfs,

I have problems with btrfs labels.

My way:

2-TByte-disk:

mkfs.btrs LABEL=MM2 /dev/sdd2

worked.
Mounting "mount LABEL=MM2 /srv/MM" worked.

Additional 1.5-TByte-Disk:

btrfs add device /dev/sdc3 /srv/MM
... balance ...

worked.

findfs LABEL=MM2

shows "/dev/sdd2" (the first partition)

file -s /dev/sdd2
file -s /dev/sdc3

shows "LABEL=MM2" for both partitions (that's not good).

Unmounting "/srv/MM" and

mount LABEL=MM2 /srv/MM

doesn't work now, it tries to mount /dev/sdd2 and mourns.

mount /dev/sdd2 /srv/MM

shows the same error message,

mount /dev/sdc3 /srv/MM

(mounting the added partition) works fine, the whole space is available.

But what can I do with the 2 identical labels? How can I delete (or change) the label of the first btrfs partition?

----------------------------

By the way:

"df" shows about 3.4 TByte usable space (2 TByte and 1.5 TByte), but

btrfs filesystem df /srv/MM

tells

        Data: total=2.70TB, used=1.64TB

I'm missing about 0.7 TByte!

Viele Gruesse!
Helmut

#1 lore raw
Quoted 20 lines · Helmut Hullen

Hallo, linux-btrfs,

I have problems with btrfs labels.

My way:

2-TByte-disk:

mkfs.btrs LABEL=MM2 /dev/sdd2

worked.
Mounting "mount LABEL=MM2 /srv/MM" worked.

Additional 1.5-TByte-Disk:

btrfs add device /dev/sdc3 /srv/MM
... balance ...

worked.

Quoted 8 lines

findfs LABEL=MM2

shows "/dev/sdd2" (the first partition)

file -s /dev/sdd2
file -s /dev/sdc3

shows "LABEL=MM2" for both partitions (that's not good).

No, this is both good and correct. You've got a single filesystem
spanning multiple block devices. The *filesystem* possesses the label, and with btrfs you can mount the filesystem using *any* of the block devices that compose it, so both block devices should indeed show the FS label, which is what's happening here.

Quoted 9 lines

Unmounting "/srv/MM" and

mount LABEL=MM2 /srv/MM

doesn't work now, it tries to mount /dev/sdd2 and mourns.

mount /dev/sdd2 /srv/MM

shows the same error message,

What's the error message? What do you get in your kernel logs when
you do this? This should work, so there's something wrong, but it's (probably) not to do with disk labels.

Quoted 6 lines

mount /dev/sdc3 /srv/MM

(mounting the added partition) works fine, the whole space is available.

But what can I do with the 2 identical labels? How can I delete (or change) the label of the first btrfs partition?

You can't, as I explained above.

Quoted 6 lines

----------------------------

By the way:

"df" shows about 3.4 TByte usable space (2 TByte and 1.5 TByte), but

Quoted 7 lines

btrfs filesystem df /srv/MM

tells

        Data: total=2.70TB, used=1.64TB

I'm missing about 0.7 TByte!

In "btrfs filesystem df", the "total" field is the space that has
been allocated to block groups. As more space is needed on the filesystem, the "total" field will increase to use up the additional raw storage (if you're using RAID1 or RAID10, this will be at a ratio of 2:1; with RAID0 or simple allocation, the ratio is 1:1).

Hugo.

Signature · 4 lines
=== Hugo Mills: hugo@... carfax.org.uk | darksatanic.net | lug.org.uk ===
  PGP key: 515C238D from wwwkeys.eu.pgp.net or http://www.carfax.org.uk
      --- In event of Last Trump,  please form an orderly queue ---      
                          and await judgement.                           
#2 lore raw

Hallo, Hugo,

Du meintest am 10.11.10:

Quoted 21 lines
Quoted 8 lines

findfs LABEL=MM2

shows "/dev/sdd2" (the first partition)

file -s /dev/sdd2
file -s /dev/sdc3

shows "LABEL=MM2" for both partitions (that's not good).

No, this is both good and correct. You've got a single filesystem
spanning multiple block devices. The *filesystem* possesses the label, and with btrfs you can mount the filesystem using *any* of the block devices that compose it, so both block devices should indeed show the FS label, which is what's happening here.

Quoted 6 lines

Unmounting "/srv/MM" and

mount LABEL=MM2 /srv/MM

doesn't work now, it tries to mount /dev/sdd2 and mourns.

Quoted 7 lines
Quoted 3 lines

mount /dev/sdd2 /srv/MM

shows the same error message,

What's the error message? What do you get in your kernel logs when
you do this? This should work, so there's something wrong, but it's (probably) not to do with disk labels.

I'll tell tomorrow; the system is just copying more than 1 TByte ...

Quoted 10 lines
Quoted 10 lines

----------------------------

By the way:

"df" shows about 3.4 TByte usable space (2 TByte and 1.5 TByte), but

btrfs filesystem df /srv/MM

tells

Quoted 8 lines
Quoted 3 lines
        Data: total=2.70TB, used=1.64TB

I'm missing about 0.7 TByte!

In "btrfs filesystem df", the "total" field is the space that has
been allocated to block groups. As more space is needed on the filesystem, the "total" field will increase to use up the additional raw storage

Ok - and many thanks! I'll see tomorrow ...

Viele Gruesse!
Helmut

#3 lore raw
In reply to Hugo Mills

Hallo, Hugo,

Du meintest am 10.11.10:

Quoted 8 lines
Quoted 8 lines

findfs LABEL=MM2

shows "/dev/sdd2" (the first partition)

file -s /dev/sdd2
file -s /dev/sdc3

shows "LABEL=MM2" for both partitions

[...]

Quoted 9 lines
Quoted 5 lines

Unmounting "/srv/MM" and

mount LABEL=MM2 /srv/MM

doesn't work now, it tries to mount /dev/sdd2 and mourns.

What's the error message? What do you get in your kernel logs when
you do this? This should work, so there's something wrong, but it's (probably) not to do with disk labels.

Strange - very strange ...

Today in the morning it didn't work. Now it works.

I'll see tomorrow if this strange behaviour is related somehow to cold start or some other commands before invoking "mount".

Viele Gruesse!
Helmut

#4 lore raw
In reply to Hugo Mills

Hallo, Hugo,

Du meintest am 10.11.10:

Quoted 9 lines
Quoted 8 lines

findfs LABEL=MM2

shows "/dev/sdd2" (the first partition)

file -s /dev/sdd2
file -s /dev/sdc3

shows "LABEL=MM2" for both partitions

Quoted 7 lines
Quoted 7 lines

mount LABEL=MM2 /srv/MM

doesn't work now, it tries to mount /dev/sdd2 and mourns.

mount /dev/sdd2 /srv/MM

shows the same error message,

# mount LABEL=MM2
mount: wrong fs type, bad option, bad superblock on /dev/sdd2,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so
# mount /dev/sdd2
mount: wrong fs type, bad option, bad superblock on /dev/sdd2,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so
Quoted 8 lines

What's the error message? What do you get in your kernel logs when
you do this? This should work, so there's something wrong, but it's (probably) not to do with disk labels.

Quoted 4 lines

mount /dev/sdc3 /srv/MM

(mounting the added partition) works fine, the whole space is available.

That's the behaviour after a cold boot.

umount /srv/MM
mount LABEL=MM2 /srv/MM

then works.
Only the first try with LABEL or with "the other" device seems to fail.

I don't like testing via reboot ...

Viele Gruesse!
Helmut

#5 lore raw

Hi.

Quoted 42 lines · Helmut Hullen

Hallo, Hugo,

Du meintest am 10.11.10:

Quoted 9 lines
Quoted 8 lines

findfs LABEL=MM2

shows "/dev/sdd2" (the first partition)

file -s /dev/sdd2
file -s /dev/sdc3

shows "LABEL=MM2" for both partitions

Quoted 7 lines
Quoted 7 lines

mount LABEL=MM2 /srv/MM

doesn't work now, it tries to mount /dev/sdd2 and mourns.

mount /dev/sdd2 /srv/MM

shows the same error message,

# mount LABEL=MM2
mount: wrong fs type, bad option, bad superblock on /dev/sdd2,
        missing codepage or helper program, or other error
        In some cases useful info is found in syslog - try
        dmesg | tail  or so
# mount /dev/sdd2
mount: wrong fs type, bad option, bad superblock on /dev/sdd2,
        missing codepage or helper program, or other error
        In some cases useful info is found in syslog - try
        dmesg | tail  or so
Quoted 8 lines

What's the error message? What do you get in your kernel logs when
you do this? This should work, so there's something wrong, but it's (probably) not to do with disk labels.

Quoted 4 lines

mount /dev/sdc3 /srv/MM

(mounting the added partition) works fine, the whole space is available.

Quoted 7 lines

That's the behaviour after a cold boot.

umount /srv/MM
mount LABEL=MM2 /srv/MM

then works.
Only the first try with LABEL or with "the other" device seems to fail.

I encountered the same problem, too.
Please try 'btrfsctl -a' before mounting.

Thanks.
Itoh

#6 lore raw

Am Thu, 11 Nov 2010 17:37:38 +0900
schrieb Tsutomu Itoh <[email protected]>:

Quoted 54 lines

Hi.

Quoted 42 lines · Helmut Hullen

Hallo, Hugo,

Du meintest am 10.11.10:

Quoted 9 lines
Quoted 8 lines

findfs LABEL=MM2

shows "/dev/sdd2" (the first partition)

file -s /dev/sdd2
file -s /dev/sdc3

shows "LABEL=MM2" for both partitions

Quoted 7 lines
Quoted 7 lines

mount LABEL=MM2 /srv/MM

doesn't work now, it tries to mount /dev/sdd2 and mourns.

mount /dev/sdd2 /srv/MM

shows the same error message,

# mount LABEL=MM2
mount: wrong fs type, bad option, bad superblock on /dev/sdd2,
        missing codepage or helper program, or other error
        In some cases useful info is found in syslog - try
        dmesg | tail  or so
# mount /dev/sdd2
mount: wrong fs type, bad option, bad superblock on /dev/sdd2,
        missing codepage or helper program, or other error
        In some cases useful info is found in syslog - try
        dmesg | tail  or so
Quoted 8 lines

What's the error message? What do you get in your kernel logs
when you do this? This should work, so there's something wrong, but it's (probably) not to do with disk labels.

Quoted 4 lines

mount /dev/sdc3 /srv/MM

(mounting the added partition) works fine, the whole space is available.

Quoted 8 lines

That's the behaviour after a cold boot.

umount /srv/MM
mount LABEL=MM2 /srv/MM

then works.
Only the first try with LABEL or with "the other" device seems to fail.

Quoted 5 lines

I encountered the same problem, too.
Please try 'btrfsctl -a' before mounting.

Thanks.
Itoh

btrfsctl is deprecated.

Please use "btrfs device scan" instead.

Regards,
Felix

Quoted 6 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#7 lore raw
In reply to Tsutomu Itoh

Hallo, Tsutomu,

Du meintest am 11.11.10:

[cold start]

Quoted 8 lines
Quoted 5 lines
# mount LABEL=MM2
mount: wrong fs type, bad option, bad superblock on /dev/sdd2,
        missing codepage or helper program, or other error
        In some cases useful info is found in syslog - try
        dmesg | tail  or so

I encountered the same problem, too.
Please try 'btrfsctl -a' before mounting.

It works - thank you!

Another problem (I had mentioned it some days before):

btrfsctl -a

tests every block device in "/dev". And as I don't use "udev" there are many device entries without an existing devices (p.e. hda1 to hda31). "btrfsctl" should use something like "/proc/partitions" to test only existing devices.

I have to call

/sbin/btrfsctl -a 2>/dev/null

to make the output readable, and suppressing error messages is no good style.

Viele Gruesse!
Helmut

#8 lore raw
In reply to Tsutomu Itoh

Hallo, Tsutomu,

Du meintest am 11.11.10:

Quoted 11 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

mount LABEL=MM2 /srv/MM

doesn't work now, it tries to mount /dev/sdd2 and mourns.

mount /dev/sdd2 /srv/MM

shows the same error message,

I encountered the same problem, too.
Please try 'btrfsctl -a' before mounting.

This command (or "/sbin/btrfs device scan 2>/dev/null") has to be put into the "init" procedure; it may be needed in runlevel 1 too, it may be needed if the root partition is a btrfs partition.

In my homemade slackware/sysv installation I have put this command into "/etc/init.d/boot", maybe for slackware it has to be put into "/etc/ rc.d/rc.S".

Viele Gruesse!
Helmut