From: Paul E Condon on
On 20100321_181749, Ron Johnson wrote:
> On 2010-03-21 17:52, Tom H wrote:
> >>>>*You* should not need to set the UUID. It should just magically be
> >>>>there.
> >>>>$ /sbin/blkid -t TYPE=swap
> >>>>/dev/sdb1: TYPE="swap" LABEL="swap1" \
> >>>>UUID="c69f59ff-b928-4232-b44c-8da0f12c52db"
> >
> >>>You can cnahe the UUID of any ext partition with
> >
> >>cnahe???
> >
> >It is Sunday and my first weekend off in a few weeks so my fingers are
> >on holiday...
> >
> >
> >>>tune2fs -U <uuid> /dev/...
> >
> >>But you're *not* supposed to *need* to,
> >
> >You do need to do so if you install a second/third/fourth...
> >distribution or version and mkswap changes the UUID of the swap
>
> I'd want *proof* (i.e., booting into different distros) that
> different mkswap invocations generate different UUIDs.
>

My reading of man mkswap is that if you don't use the -U option, the
program generates a new, random UUID. Debian will change it's own UUID
if you re-execute mkswap on the same partition, and all other distros
are likely to do the same.


> >partition (although I _think_ that you can use "mkswap -U <uuid>") and
> >you therefore have to boot without swap from your previous install(s).
> >
>
> Or... use a LABEL.
>

I don't see a way to apply a label to a swap partition. Where can I
find out about such?


--
Paul E Condon
pecondon(a)mesanetworks.net


--
To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org
Archive: http://lists.debian.org/20100322045123.GB29954(a)big.lan.gnu
From: Ron Johnson on
On 2010-03-21 23:51, Paul E Condon wrote:
> On 20100321_181749, Ron Johnson wrote:
>> On 2010-03-21 17:52, Tom H wrote:
>>>>>> *You* should not need to set the UUID. It should just magically be
>>>>>> there.
>>>>>> $ /sbin/blkid -t TYPE=swap
>>>>>> /dev/sdb1: TYPE="swap" LABEL="swap1" \
>>>>>> UUID="c69f59ff-b928-4232-b44c-8da0f12c52db"
>>>>> You can cnahe the UUID of any ext partition with
>>>> cnahe???
>>> It is Sunday and my first weekend off in a few weeks so my fingers are
>>> on holiday...
>>>
>>>
>>>>> tune2fs -U <uuid> /dev/...
>>>> But you're *not* supposed to *need* to,
>>> You do need to do so if you install a second/third/fourth...
>>> distribution or version and mkswap changes the UUID of the swap
>> I'd want *proof* (i.e., booting into different distros) that
>> different mkswap invocations generate different UUIDs.
>>
>
> My reading of man mkswap is that if you don't use the -U option, the
> program generates a new, random UUID. Debian will change it's own UUID
> if you re-execute mkswap on the same partition, and all other distros
> are likely to do the same.
>

Huh, you're right!

$ date && /sbin/blkid -t TYPE=swap
Mon Mar 22 01:59:13 CDT 2010
/dev/sdb1: TYPE="swap" LABEL="swap1" \
UUID="c69f59ff-b928-4232-b44c-8da0f12c52db"

# date && mkswap /dev/sdb1
Mon Mar 22 01:59:46 CDT 2010
Setting up swapspace version 1, size = 2000056 KiB
no label, UUID=7adf36e1-ec23-4eac-b49c-5c06c0439a10

$ date && /sbin/blkid -t TYPE=swap
Mon Mar 22 02:00:32 CDT 2010
/dev/sdb1: TYPE="swap" LABEL="swap1" \
UUID="7adf36e1-ec23-4eac-b49c-5c06c0439a10"

# mkswap -L foobar /dev/sdb1
Setting up swapspace version 1, size = 2000056 KiB
LABEL=foobar, UUID=25c86597-cdd4-48c9-9543-0d50590848f8

$ date && /sbin/blkid -t TYPE=swap
Mon Mar 22 02:04:49 CDT 2010
/dev/sdb1: TYPE="swap" LABEL="foobar" \
UUID="25c86597-cdd4-48c9-9543-0d50590848f8"



>>> partition (although I _think_ that you can use "mkswap -U <uuid>") and
>>> you therefore have to boot without swap from your previous install(s).
>>>
>> Or... use a LABEL.
>>
>
> I don't see a way to apply a label to a swap partition. Where can I
> find out about such?
>

mkswap -L foobar /dev/XXYn


What I'd do is:

# swapoff /dev/XXYn

# mkswap -L foobar /dev/XXYn

# vi /etc/fstab

# vi /mnt/other_distro/etc/fstab

--
"History does not long entrust the care of freedom to the weak
or the timid." Dwight Eisenhower


--
To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org
Archive: http://lists.debian.org/4BA717BE.7030003(a)cox.net
From: Paul E Condon on
On 20100322_020950, Ron Johnson wrote:
> On 2010-03-21 23:51, Paul E Condon wrote:
> >On 20100321_181749, Ron Johnson wrote:
> >>On 2010-03-21 17:52, Tom H wrote:
> >>>>>>*You* should not need to set the UUID. It should just magically be
> >>>>>>there.
> >>>>>>$ /sbin/blkid -t TYPE=swap
> >>>>>>/dev/sdb1: TYPE="swap" LABEL="swap1" \
> >>>>>>UUID="c69f59ff-b928-4232-b44c-8da0f12c52db"
> >>>>>You can cnahe the UUID of any ext partition with
> >>>>cnahe???
> >>>It is Sunday and my first weekend off in a few weeks so my fingers are
> >>>on holiday...
> >>>
> >>>
> >>>>>tune2fs -U <uuid> /dev/...
> >>>>But you're *not* supposed to *need* to,
> >>>You do need to do so if you install a second/third/fourth...
> >>>distribution or version and mkswap changes the UUID of the swap
> >>I'd want *proof* (i.e., booting into different distros) that
> >>different mkswap invocations generate different UUIDs.
> >>
> >
> >My reading of man mkswap is that if you don't use the -U option, the
> >program generates a new, random UUID. Debian will change it's own UUID
> >if you re-execute mkswap on the same partition, and all other distros
> >are likely to do the same.
> >
>
> Huh, you're right!
>
> $ date && /sbin/blkid -t TYPE=swap
> Mon Mar 22 01:59:13 CDT 2010
> /dev/sdb1: TYPE="swap" LABEL="swap1" \
> UUID="c69f59ff-b928-4232-b44c-8da0f12c52db"
>
> # date && mkswap /dev/sdb1
> Mon Mar 22 01:59:46 CDT 2010
> Setting up swapspace version 1, size = 2000056 KiB
> no label, UUID=7adf36e1-ec23-4eac-b49c-5c06c0439a10
>
> $ date && /sbin/blkid -t TYPE=swap
> Mon Mar 22 02:00:32 CDT 2010
> /dev/sdb1: TYPE="swap" LABEL="swap1" \
> UUID="7adf36e1-ec23-4eac-b49c-5c06c0439a10"
>
> # mkswap -L foobar /dev/sdb1
> Setting up swapspace version 1, size = 2000056 KiB
> LABEL=foobar, UUID=25c86597-cdd4-48c9-9543-0d50590848f8
>
> $ date && /sbin/blkid -t TYPE=swap
> Mon Mar 22 02:04:49 CDT 2010
> /dev/sdb1: TYPE="swap" LABEL="foobar" \
> UUID="25c86597-cdd4-48c9-9543-0d50590848f8"
>
>
>
> >>>partition (although I _think_ that you can use "mkswap -U <uuid>") and
> >>>you therefore have to boot without swap from your previous install(s).
> >>>
> >>Or... use a LABEL.
> >>
> >
> >I don't see a way to apply a label to a swap partition. Where can I
> >find out about such?
> >
>
> mkswap -L foobar /dev/XXYn
>
>
> What I'd do is:
>
> # swapoff /dev/XXYn
>
> # mkswap -L foobar /dev/XXYn
>
> # vi /etc/fstab
>
> # vi /mnt/other_distro/etc/fstab
>

Thanks Ron,

You answered my question --- I didn't know about blkid utility.
With this one can give every partition a meaningful labels like ---

LABEL="hda1"

or whatever is displayed as the system device one one runs blkid
without options in order to get a full listing. e.g.
cmpq:~# blkid
/dev/hda1: UUID="990189bc-f7ce-41a6-9d8f-64a35349875e" TYPE="ext3"
/dev/hda2: LABEL="HDA2" UUID="5a02e986-8aa3-4790-aa3f-41f7f565533f" TYPE="ext3"
/dev/hda3: LABEL="HDA3" UUID="63025622-0210-49d4-89ff-f038e6c218b6" TYPE="ext3"
/dev/hda5: TYPE="swap"
/dev/hda6: LABEL="HDA6" UUID="12148027-bc0b-4260-853e-64a8d79c6fe7" TYPE="ext3"
/dev/hdb1: UUID="29b36e91-32e7-46bd-b8d3-831f5dcbd337" TYPE="ext3"
/dev/sda1: LABEL="WDMB-1" UUID="bc1d2170-d790-4952-bbee-c3c3efdd8413" TYPE="ext3"
/dev/sdb1: LABEL="WDP-5" UUID="8c6c3be3-4a72-45cd-929f-2dec9f185427" TYPE="ext3"

This is from a system that is running Lenny. Note that the swap partition doesn't
have either a label or a uuid, but I had specified labels each time I installed
a distro.

--
Paul E Condon
pecondon(a)mesanetworks.net


--
To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org
Archive: http://lists.debian.org/20100322220557.GC29954(a)big.lan.gnu
From: Ron Johnson on
On 2010-03-22 17:05, Paul E Condon wrote:
[snip]
>
> You answered my question --- I didn't know about blkid utility.
> With this one can give every partition a meaningful labels like ---
>
> LABEL="hda1"
>
> or whatever is displayed as the system device one one runs blkid
> without options in order to get a full listing. e.g.
> cmpq:~# blkid
> /dev/hda1: UUID="990189bc-f7ce-41a6-9d8f-64a35349875e" TYPE="ext3"
> /dev/hda2: LABEL="HDA2" UUID="5a02e986-8aa3-4790-aa3f-41f7f565533f" TYPE="ext3"
> /dev/hda3: LABEL="HDA3" UUID="63025622-0210-49d4-89ff-f038e6c218b6" TYPE="ext3"
> /dev/hda5: TYPE="swap"
> /dev/hda6: LABEL="HDA6" UUID="12148027-bc0b-4260-853e-64a8d79c6fe7" TYPE="ext3"
> /dev/hdb1: UUID="29b36e91-32e7-46bd-b8d3-831f5dcbd337" TYPE="ext3"
> /dev/sda1: LABEL="WDMB-1" UUID="bc1d2170-d790-4952-bbee-c3c3efdd8413" TYPE="ext3"
> /dev/sdb1: LABEL="WDP-5" UUID="8c6c3be3-4a72-45cd-929f-2dec9f185427" TYPE="ext3"

Gah!!! "HDAn" are *horrible* labels.

When you add another hard drive, the kernel might make it hda and
your existing drive hdb. Or libata might convert them to sdx and
then you'd have sda2 with label HDA2. *Very* unintuitive!

Or you might need to move the drive to a machine that already has a
partition labeled HDA2.

Give them meaningful *symbolic* names.

> This is from a system that is running Lenny. Note that the swap partition doesn't
> have either a label or a uuid, but I had specified labels each time I installed
> a distro.
>

That's weird.

--
"History does not long entrust the care of freedom to the weak
or the timid." Dwight Eisenhower


--
To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org
Archive: http://lists.debian.org/4BA7F463.8010906(a)cox.net
From: Tom H on
>>> I'd want *proof* (i.e., booting into different distros) that different
>>> mkswap invocations generate different UUIDs.

>> I have no idea what proof I can provide except to say that I have been
>> caught by that.

>> I installed a second distribution and I could either not prevent it
>> from running mkswap or forgot to prevent it from doing so and I had,
>> when I rebooted into the first distribution, an error message about
>> swap. And it turned out that the swap UUID had been modified.

> Expert install or simple install?

The partioner is the same for both; and why does it matter anyway
since the UUID was modified?


--
To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org
Archive: http://lists.debian.org/6d4219cc1003221739y66234d71pf05e388fe4e55377(a)mail.gmail.com