Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 06-17-2009, 10:03 AM   #1
Registered: Feb 2008
Posts: 443
Blog Entries: 1

Rep: Reputation: 38
can I label a swap partition or find its UUID ?

My /dev/sda2 is a swap partition.

[root@centos52-64-fuj /]# e2label /dev/sda2
e2label: Bad magic number in super-block while trying to open /dev/sda2
Couldn't find valid filesystem superblock.
[root@centos52-64-fuj /]# dumpe2fs /dev/sda2
dumpe2fs 1.39 (29-May-2006)
dumpe2fs: Bad magic number in super-block while trying to open /dev/sda2
Couldn't find valid filesystem superblock.

I am trying to label a swap partition or to find out its UUID. Thanks.
Old 06-17-2009, 10:12 AM   #2
Registered: Dec 2007
Location: Charleston WV, USA
Distribution: Slackware 12.2, Arch Linux Amd64
Posts: 896

Rep: Reputation: 70
e2label and dumpe2fs work with the ext2/3 filesystems.
Try the
Old 06-17-2009, 10:39 AM   #3
LQ Guru
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,243
Blog Entries: 5

Rep: Reputation: 190Reputation: 190
man mkswap

mkswap -L label-name /dev/device

ls -al /dev/disk/by-uuid
ls -al /dev/disk/by-id
ls -al /dev/disk/by-path
ls -al /dev/disk/by-label

I don't think you can assign a uuid to a swap partition.. the others should work

Last edited by farslayer; 06-17-2009 at 10:40 AM.
Old 09-12-2010, 01:37 PM   #4
LQ Newbie
Registered: Sep 2010
Posts: 2

Rep: Reputation: 0
Sorry for bringing this up but it can be usefull for other people searching this.

I turned off swap (swapoff)
Then made a label for my swap partition because i gave up trying to give it an UUID.
When the label was created, the command returned the label AND an UUID
The UUID of the swap partition is still not printed out when i ls -l by-uuid

And the UUID is valid, I use it in fstab.
(ofcourse i turned swap back on )

Hope this is helpfull to someone


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
root=UUID or root=LABEL not working actmnophn Linux - Newbie 4 02-23-2009 06:37 PM
How to LABEL Swap partition badrat Linux - Certification 4 10-19-2006 10:33 PM
very strange swap partition label and empty text console whencat Fedora 4 08-07-2005 09:16 AM
label swap device equinox Linux - General 2 02-17-2005 12:41 AM
can't find swap partition in KANOTIX subjazz Linux - Distributions 1 10-24-2004 07:49 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:53 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration