LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-23-2010, 08:39 PM   #1
_Linux_Learner
Member
 
Registered: Feb 2010
Distribution: Ubuntu
Posts: 87

Rep: Reputation: 15
uuid problem


Hi all

How can I check the UUID of the disk partition in which I am currently working.

regards
_Linux_Learner
 
Old 02-23-2010, 08:42 PM   #2
Alex_Dc
Member
 
Registered: Oct 2009
Posts: 104

Rep: Reputation: 22
Are you using multiple partitions? if not "cat /dev/disk/by-uuid" will show you.
 
Old 02-25-2010, 01:38 AM   #3
_Linux_Learner
Member
 
Registered: Feb 2010
Distribution: Ubuntu
Posts: 87

Original Poster
Rep: Reputation: 15
reply

Yes I am using multiple partitions. So I have more than more than uuids.
So now what to do.

regards
_Linux_Learner
 
Old 02-25-2010, 08:57 AM   #4
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,492

Rep: Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488Reputation: 2488
Try this:

Quote:
ls -l /dev/disk/by-uuid
 
Old 02-25-2010, 08:58 AM   #5
Alex_Dc
Member
 
Registered: Oct 2009
Posts: 104

Rep: Reputation: 22
Use the command "blkid" as any user.
 
Old 02-26-2010, 01:30 PM   #6
_Linux_Learner
Member
 
Registered: Feb 2010
Distribution: Ubuntu
Posts: 87

Original Poster
Rep: Reputation: 15
Question More descripion

Let me be more descriptive. Suppose I am working in Desktop directory. Now I want to now that what is the uuid of the partition on which this Desktop directory is present.

blkid will print all the uuids which will force me to select the correct one that I need.

regards
_Linux_Learner
 
Old 02-26-2010, 03:48 PM   #7
Alex_Dc
Member
 
Registered: Oct 2009
Posts: 104

Rep: Reputation: 22
Quote:
Originally Posted by _Linux_Learner View Post
Let me be more descriptive. Suppose I am working in Desktop directory. Now I want to now that what is the uuid of the partition on which this Desktop directory is present.

blkid will print all the uuids which will force me to select the correct one that I need.

regards
_Linux_Learner
Not sure I understand your questions, but blkid doesn't make you "choose" anything, it just prints the UUIDs of every partition. I don't know why that is a big deal, but if you only want to print the UUID for a specific partition, you can use the command "blkid | grep sdaX" (or hda, or what type of partition you have". There is no tool that will tell you the partition a particular directory is on, and give you the UUID of that partition.

Is it that you don't know how you hard drive is partitioned? If this is the case you can use the "df" command, normally used to determine disk usage, to print a list of your partitions, and what parent directories are mounted on them. The only thing that this command won't print is swap partitions, but you can determine this by process of elimination.
 
Old 02-26-2010, 04:59 PM   #8
Bratmon
Member
 
Registered: Jul 2009
Location: 75.126.162.205:80
Distribution: Arch / Mint 17
Posts: 297
Blog Entries: 3

Rep: Reputation: 50
^
Or run mount without arguments.
 
Old 02-26-2010, 06:28 PM   #9
lupusarcanus
Senior Member
 
Registered: Mar 2009
Location: USA
Distribution: Arch
Posts: 1,022
Blog Entries: 19

Rep: Reputation: 146Reputation: 146
Quote:
Originally Posted by Bratmon
Sturgeon's Law says that 90% of everything is crap. I notice Windows has about 90% of the market share.

Why Linux isn't accepted in business.

Proud to be the only happy Karmic user!
I am a happy Karmic user.
 
Old 02-26-2010, 09:28 PM   #10
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Here are some steps to do what you want from the command line; they could be implemented in a script
Code:
c@CW8:~$ df ~/Desktop
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/root             14593252   4633784   9959468  32% /
c@CW8:~$ ll /dev/root
lrwxrwxrwx 1 root root 4 Feb 27 08:01 /dev/root -> sda7
c@CW8:~$ ll /dev/disk/by-uuid/ | grep sda7
lrwxrwxrwx 1 root root 10 Feb 27 08:01 7750b4f2-3428-49b8-8654-698d4c40e656 -> ../../sda7
 
Old 02-26-2010, 11:35 PM   #11
_Linux_Learner
Member
 
Registered: Feb 2010
Distribution: Ubuntu
Posts: 87

Original Poster
Rep: Reputation: 15
Hi Catkin

This worked the way I expected. Thanks for your help. Thanks to others also.

regards
_Linux_Learner
 
  


Reply



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
Volume has problems including no uuid in /dev/disk/by-uuid abejarano Linux - Hardware 3 12-31-2008 08:41 PM
UUID keeps changing bashyow Linux - Newbie 5 09-04-2008 01:42 PM
NTFS USB flash pen - UUID problem again starter_07 Debian 5 08-14-2007 04:01 PM
Uuid hansi umayangan Linux - General 2 03-14-2005 04:57 AM
Problem installing jfsutils-1.1.7, cannot find uuid library kit_johnson Linux - Software 1 11-30-2004 08:07 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:10 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration