Mapping Swap Partition Devices to Labels

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I maintain the Linux Documentation Project HOWTO on bare metal
restoration,
http://www.charlescurley.com/Linux-Complete-Backup-and-Recovery-HOWTO.html.
As part of that, I maintain some scripts that detect hard drive setup
and in turn build other scripts to reconstruct hard drive setup.

I see that a fresh installation of FC3 will use a label to mount a
swap partition. I can examine an ext[2|3]fs partition with dumpe2fs to
determine its label, if any, or given a mounted partition, go from a
device to its label. However, swap partitions do not show up in mount
(for very good reason).

If I know I only have one swap partition, then scanning fstab gives me
the label. However, if I have multiple swap partitions, scanning fstab
is not enough. The labels for FC3 seem to be of the form "SWAP-hda5"
for /dev/hda5, but if I assume that form in my scripts, I am dependent
on that form continuing into the future. I am also dependent on system
builders other than Anaconda using that form, a dubious proposition.

Is there any tool that lets me read the label from any partition at
all, or from swap partitions in specific?

Thank you.

-- 

Charles Curley                  /"\    ASCII Ribbon Campaign
Looking for fine software       \ /    Respect for open standards
and/or writing?                  X     No HTML/RTF in email
http://www.charlescurley.com    / \    No M$ Word docs in email

Key fingerprint = CE5C 6645 A45A 64E4 94C0  809C FFF6 4C48 4ECD DFDB

Attachment: pgpQGxfAZgHLY.pgp
Description: PGP signature


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux