LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   uuid problem (https://www.linuxquestions.org/questions/linux-newbie-8/uuid-problem-791133/)

_Linux_Learner 02-23-2010 08:39 PM

uuid problem
 
Hi all

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

regards
_Linux_Learner

Alex_Dc 02-23-2010 08:42 PM

Are you using multiple partitions? if not "cat /dev/disk/by-uuid" will show you.

_Linux_Learner 02-25-2010 01:38 AM

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

regards
_Linux_Learner

yancek 02-25-2010 08:57 AM

Try this:

Quote:

ls -l /dev/disk/by-uuid

Alex_Dc 02-25-2010 08:58 AM

Use the command "blkid" as any user.

_Linux_Learner 02-26-2010 01:30 PM

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

Alex_Dc 02-26-2010 03:48 PM

Quote:

Originally Posted by _Linux_Learner (Post 3878061)
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.

Bratmon 02-26-2010 04:59 PM

^
Or run mount without arguments.

lupusarcanus 02-26-2010 06:28 PM

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.

catkin 02-26-2010 09:28 PM

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


_Linux_Learner 02-26-2010 11:35 PM

Hi Catkin

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

regards
_Linux_Learner


All times are GMT -5. The time now is 09:48 AM.