Find the answer to your Linux question:
Results 1 to 5 of 5
Hi All, Can anyone brief the difference between 'fdisk' partitioning and 'parted' partitioning. Let me explain the problem. I am using RHEL5.7. My host is configured with Native MPIO. I ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Feb 2012
    Posts
    2

    parted partition gives empty uuid


    Hi All,

    Can anyone brief the difference between 'fdisk' partitioning and 'parted' partitioning. Let me explain the problem.

    I am using RHEL5.7. My host is configured with Native MPIO. I have created 2 LUNs. I partitioned the first LUN with fdisk (fdisk /dev/mapper/<32bit uuid>), and the second one using parted (parted /dev/mapper/<32bit uuid>). To create parted partition, I executed mklabel gpt; unit s; mkpart primary 64 100%; commands.

    Then I executed the kpartx -a /dev/mapper/<32bit uuid> command for both devices, and verified the partition is created with suffix 'p1'. Now if I execute the "dmsetup info -c <32bit uuid>p1", the UUID for the parted partition is returns empty string. But the same is returning a value in fdisk partitioned device.

    Any thoughts would be appreciated..

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,746
    A UUID is not necessary to use the device. You can create a label for it as well. See the manpage for the e2label command. In any case, once labeled, you can put it in your /etc/fstab for automounting using the LABEL=name directive. Personally, I prefer labels to UUIDs since if I have to move the data to a new drive, I can label the new drive, and then boot without the system giving me the finger.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  3. #3
    Just Joined!
    Join Date
    Feb 2012
    Posts
    2
    Thanks for your reply.

    Honestly I am not familiar with linux. And my problem is little bit different.

    We create the LUNs on the client's storage box, applying the partition and creating the oracle database on top of the partition. So while backing up the database we will discover the filesystem -> partition -> device -> LUN -> volume.

    Now to find the device from the partition, we are parsing the output of the "dmsetup info -c -o uuid <partition>" command. But since the UUID is empty for parted partitions, it is failing.

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,746
    Quote Originally Posted by josephr View Post
    Thanks for your reply.

    Honestly I am not familiar with linux. And my problem is little bit different.

    We create the LUNs on the client's storage box, applying the partition and creating the oracle database on top of the partition. So while backing up the database we will discover the filesystem -> partition -> device -> LUN -> volume.

    Now to find the device from the partition, we are parsing the output of the "dmsetup info -c -o uuid <partition>" command. But since the UUID is empty for parted partitions, it is failing.
    This is fixable. First, generate new uuids using the uuidgen tool. Then set the uuids on the devices using tune2fs with the -U uuid option. From the tune2fs man page:
    Code:
           -U UUID
                  Set the universally unique identifier (UUID) of the filesystem to UUID.  The format of  the  UUID  is  a
                  series  of hex digits separated by hyphens, like this: "c1b9d5a2-f162-11cf-9ece-0020afc76f16".  The UUID
                  parameter may also be one of the following:
    
                       clear  clear the filesystem UUID
    
                       random generate a new randomly-generated UUID
    
                       time   generate a new time-based UUID
    
                  The UUID may be used by mount(8),  fsck(8),  and  /etc/fstab(5)  (and  possibly  others)  by  specifying
                  UUID=uuid instead of a block special device name like /dev/hda1.
    
                  See uuidgen(8) for more information.  If the system does not have a good random number generator such as
                  /dev/random or /dev/urandom, tune2fs will automatically use a time-based UUID instead of a randomly-gen-
                  erated UUID.
    Now, you should be in business! Also, as noted in the man page, you can use on of the other options for -U so tune2fs will generate the UUID for you automatically.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  6. #5
    Just Joined!
    Join Date
    May 2010
    Posts
    2
    Quote Originally Posted by Rubberman View Post
    This is fixable. First, generate new uuids using the uuidgen tool. Then set the uuids on the devices using tune2fs with the -U uuid option. From the tune2fs man page:
    Code:
           -U UUID
                  Set the universally unique identifier (UUID) of the filesystem to UUID.  The format of  the  UUID  is  a
                  series  of hex digits separated by hyphens, like this: "c1b9d5a2-f162-11cf-9ece-0020afc76f16".  The UUID
                  parameter may also be one of the following:
    
                       clear  clear the filesystem UUID
    
                       random generate a new randomly-generated UUID
    
                       time   generate a new time-based UUID
    
                  The UUID may be used by mount(8),  fsck(8),  and  /etc/fstab(5)  (and  possibly  others)  by  specifying
                  UUID=uuid instead of a block special device name like /dev/hda1.
    
                  See uuidgen(8) for more information.  If the system does not have a good random number generator such as
                  /dev/random or /dev/urandom, tune2fs will automatically use a time-based UUID instead of a randomly-gen-
                  erated UUID.
    Now, you should be in business! Also, as noted in the man page, you can use on of the other options for -U so tune2fs will generate the UUID for you automatically.
    Well - while this will enable us to generate a uuid, it doesn't help in cases where you want to use this uuid to figure out the type of the DM device.
    In my case, I look for the uuids to figure out if it contains strings 'mpath-' or 'LVM2' or 'part<num>-mpath' to check for 'multipath device', 'LVM pv' or 'multipath device partition', respectively.
    Any idea, how we could generate the uuid in the same format like other tools?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •