Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: Disklabel type

302 views
Skip to first unread message

David

unread,
Jun 27, 2021, 7:00:06 AM6/27/21
to
On Sun, 27 Jun 2021 at 20:05, mick crane <mick....@gmail.com> wrote:
>
> I don't know what happened here.
> Can I change the Disklabel without messing things up or is it necessary
> ?
>
> root@pumpkin:~# fdisk /dev/sda
> Disk /dev/sda: 223.57 GiB, 240057409536 bytes, 468862128 sectors
> Disk model: KINGSTON SA400S3
> Units: sectors of 1 * 512 = 512 bytes
> Sector size (logical/physical): 512 bytes / 512 bytes
> I/O size (minimum/optimal): 512 bytes / 512 bytes
> Disklabel type: dos
> Disk identifier: 0x64b83d98
>
> Device Boot Start End Sectors Size Id Type
> /dev/sda1 * 2048 499711 497664 243M 83 Linux
> /dev/sda2 501758 468860927 468359170 223.3G 5 Extended
> /dev/sda5 501760 468860927 468359168 223.3G 8e Linux LVM
>
>
> root@pumpkin:~# e2label /dev/sda
> e2label: Bad magic number in super-block while trying to open /dev/sda
> Found a dos partition table in /dev/sda

You're trying to apply a *filesystem* label to a block *device*.
That cannot work.

It's hard to know what your goal is there, but perhaps 'e2label /dev/sda1'
is what you actually want. The partition information above doesn't
suggest any other possibilites that would succeed.

David

unread,
Jun 27, 2021, 7:10:05 AM6/27/21
to
On Sun, 27 Jun 2021 at 20:51, David <bounci...@gmail.com> wrote:

> You're trying to apply a *filesystem* label to a block *device*.
> That cannot work.

Not the best wording, sorry, I'll try to be a bit clearer.

Your command failed because it tried to apply a *filesystem* label to a
partitioned block device /dev/sda. That cannot work because /dev/sda
is currently not an extN filesystem. /dev/sda rather contains a partition table
and partitions. And in this case, as is very common, it is the partition
that likely contains an extN filesystem. The only partition that you show
that does contain a extN filesystem is /dev/sda1.

/dev/sda2 contains an extended msdos partition, which is not a
extN filesystem.

/dev/sda5 is a logical partition inside /dev/sda2, and
it is being used by LVM, so the device /dev/sda5 also is not
an extN filesystem. Although some of the LVM devices inside it
may well be extN filesystems providing your root and home.

Thomas Schmitt

unread,
Jun 27, 2021, 7:20:04 AM6/27/21
to
Hi,

mick crane wrote:
> I don't know what happened here.
> Can I change the Disklabel without messing things up or is it necessary ?
>
> root@pumpkin:~# fdisk /dev/sda
> Disk /dev/sda: 223.57 GiB, 240057409536 bytes, 468862128 sectors
> [...]
> Disklabel type: dos

If you are worried about the "dos" in "Disklabel type:" then it is not
necessary. This line just tells that the disk is partitioned by a MBR
partition table rather than by GPT.


Have a nice day :)

Thomas

Andrei POPESCU

unread,
Jun 27, 2021, 8:10:04 AM6/27/21
to
On Du, 27 iun 21, 11:04:54, mick crane wrote:
> I don't know what happened here.
> Can I change the Disklabel without messing things up or is it necessary ?

Careful, 'Disklabel' below is a synonym for 'Partition table' (of type
'dos' in this particular case).

> root@pumpkin:~# fdisk /dev/sda
> Disk /dev/sda: 223.57 GiB, 240057409536 bytes, 468862128 sectors
> Disk model: KINGSTON SA400S3
> Units: sectors of 1 * 512 = 512 bytes
> Sector size (logical/physical): 512 bytes / 512 bytes
> I/O size (minimum/optimal): 512 bytes / 512 bytes
> Disklabel type: dos
> Disk identifier: 0x64b83d98
>
> Device Boot Start End Sectors Size Id Type
> /dev/sda1 * 2048 499711 497664 243M 83 Linux
> /dev/sda2 501758 468860927 468359170 223.3G 5 Extended
> /dev/sda5 501760 468860927 468359168 223.3G 8e Linux LVM
>
>
> root@pumpkin:~# e2label /dev/sda
> e2label: Bad magic number in super-block while trying to open /dev/sda
> Found a dos partition table in /dev/sda

Fortunately `e2label` is smart enough to recognize your drive is
partitioned and leave it alone[1], otherwise you might be in serious
trouble now.

What do you actually want to achieve?


[1] as far as I know it's possible to format a drive directly, without
any partition table, but this is generally not recommended and should be
avoided.

Kind regards,
Andrei
--
http://wiki.debian.org/FAQsFromDebianUser
signature.asc
0 new messages