Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Linux: Kernel

Fwd: show label for swap partition.

 

 

Linux kernel RSS feed   Index | Next | Previous | View Threaded


japrice at gmail

Jan 28, 2008, 11:58 AM

Post #1 of 3 (4095 views)
Permalink
Fwd: show label for swap partition.

I apologize if this is the wrong forum. Please CC me on replies.

A admin accidentally deleted the swap line from the fstab file. We
mount the swap filesystem via labels. However, there seems to be no
way to list the label on an existing swap partition, via the command
line swap tools (mkswap, swapon/off, etc)

Is this blindness on my part, or should there be an analog to e2label
for swap partitions?

--Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


zlynx at acm

Jan 28, 2008, 12:10 PM

Post #2 of 3 (4044 views)
Permalink
Re: Fwd: show label for swap partition. [In reply to]

On Mon, 2008-01-28 at 14:58 -0500, Jason Price wrote:
> I apologize if this is the wrong forum. Please CC me on replies.
>
> A admin accidentally deleted the swap line from the fstab file. We
> mount the swap filesystem via labels. However, there seems to be no
> way to list the label on an existing swap partition, via the command
> line swap tools (mkswap, swapon/off, etc)
>
> Is this blindness on my part, or should there be an analog to e2label
> for swap partitions?

There's this cheesy way to get it:
# dd if=swapfile bs=4k count=1 | xxd -a
1+0 records in
1+0 records out
4096 bytes (4.1 kB) copied, 6.2589e-05 s, 65.4 MB/s
0000000: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
0000400: 0100 0000 ffff 0000 0000 0000 f209 fce3 ................
0000410: 7bc9 486d ac86 5d63 af25 3c99 466c 6173 {.Hm..]c.%<.Flas
0000420: 6853 7761 7000 0000 0000 0000 0000 0000 hSwap...........
0000430: 0000 0000 0000 0000 0000 0000 0000 0000 ................
*
0000ff0: 0000 0000 0000 5357 4150 5350 4143 4532 ......SWAPSPACE2

You can see it is marked as SWAPSPACE2. The label is FlashSwap. Looks
like it appears at offset 0x41c.
--
Zan Lynx <zlynx [at] acm>
Attachments: signature.asc (0.18 KB)


jengelh at computergmbh

Jan 28, 2008, 12:53 PM

Post #3 of 3 (4039 views)
Permalink
Re: Fwd: show label for swap partition. [In reply to]

On Jan 28 2008 20:10, Zan Lynx wrote:
>On Mon, 2008-01-28 at 14:58 -0500, Jason Price wrote:
>> I apologize if this is the wrong forum. Please CC me on replies.
>>
>> A admin accidentally deleted the swap line from the fstab file. We
>> mount the swap filesystem via labels. However, there seems to be no
>> way to list the label on an existing swap partition, via the command
>> line swap tools (mkswap, swapon/off, etc)
>>
>> Is this blindness on my part, or should there be an analog to e2label
>> for swap partitions?

# blkid /dev/mapper/swap0
swap0: UUID="502e549d-d8b4-4c08-9b27-3d3e9cefed92" TYPE="swap"

Works.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Linux kernel RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.