How do I find out the label of a swap partition?

Paul Howarth paul at city-fan.org
Mon Aug 15 07:49:02 UTC 2005


On Sun, 2005-08-14 at 23:18 -0500, Jeff Vian wrote:
> On Sun, 2005-08-14 at 20:49 -0600, Charles Curley wrote:
> > How do I find out the label of a swap partition?
> > 
> > I'm working on bare metal recovery
> > (http://www.tldp.org/HOWTO/Linux-Complete-Backup-and-Recovery-HOWTO/index.html). Now
> > that Fedora uses labels to identify swap partitions as well as file
> > system partitions, I need to learn what the swap partition label is so
> > that the bare metal recovery scripts can properly make the swap
> > partitions.
> > 
> > I can learn the labels of the file system partitions with mount -l,
> > but that does not help with swap partitions.
> > 
> > I could parse /etc/fstab, but that may not be accurate, e.g. I changed
> > my fstab to use the device name for swap, but there is a label on the
> > partition. Also, with the current problem of garbage labels for the
> > swap partitions, it is hazardous anyway.
> > 
> 
> use e2label.
> the man page will help

e2label is only likely to help for ext2/ext3 filesystems. The OP is
after a way of finding the label on a swap partition. I don't know of
any way of doing that other than writing a program to examine the label
on each partition.

Paul.
-- 
Paul Howarth <paul at city-fan.org>




More information about the fedora-list mailing list