LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices

Reply
 
LinkBack Search this Thread
Old 06-17-2009, 10:03 AM   #1
centguy
Member
 
Registered: Feb 2008
Posts: 390
Blog Entries: 1

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


My /dev/sda2 is a swap partition.

Quote:
[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.
and
Quote:
[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
Uncle_Theodore
Member
 
Registered: Dec 2007
Location: Charleston WV, USA
Distribution: Slackware 12.2, Arch Linux Amd64
Posts: 896

Rep: Reputation: 60
e2label and dumpe2fs work with the ext2/3 filesystems.
Try the
blkid
command.
 
Old 06-17-2009, 10:39 AM   #3
farslayer
Guru
 
Registered: Oct 2005
Location: Willoughby, Ohio
Distribution: linuxdebian
Posts: 7,231
Blog Entries: 5

Rep: Reputation: 189Reputation: 189
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
nsine
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
 
  


Reply


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
Trackbacks are Off
Pingbacks are On
Refbacks are 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


All times are GMT -5. The time now is 11:03 AM.

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