Author Topic: UUID  (Read 875 times)

Offline Yankee

  • Hero Member
  • *****
  • Posts: 1475
  • In theory, theory=practice, in practice ???
UUID
« on: October 06, 2010, 02:21:06 PM »

Hello,

I put the same fsarchiver backup on two drives and they will not mount with each other
because the UUID'S are the same.  Good checking by LINUX.   Beginner's mistake too.

Both are xfs filesystems and "xfs admin -Ugenerate /dev/sdd" will generate a new UUID
for one of them.  Problem solved except the "xfs admin" command doesn't seem to be in the
xfsutils on Xfce. 

Any other command available that we have ?


Cheers,

Patrick013
ASUS EeePc 900HA netbook  1.6 Ghz Atom CPU  1GB RAM
160 GB internal HD    Seagate 250 GB USB portable drive 
Intel ‎Mobile 945GSE Integrated Graphics Controller
Atheros AR242x/AR542x Wireless Network Adapter
Intel (N10/ICH7 Family) High Definition Audio
Dynex 5-Button Wired Optical Mouse
LXDE

Offline Joble

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 6804
  • USA - Mountain Time
Re: UUID
« Reply #1 on: October 06, 2010, 02:30:13 PM »
Search First.
Forum Rules
Hero means I talk a lot, nothing more, nothing less!
Have an Awesome Day!
Healthy System

Offline Yankee

  • Hero Member
  • *****
  • Posts: 1475
  • In theory, theory=practice, in practice ???
Re: UUID
« Reply #2 on: October 06, 2010, 03:18:24 PM »
blkid maybe?
http://linux.die.net/man/8/blkid





That one only displays, doesn't look like it will change a xfs UUID.  Just read it.


Cheers,

Patrick013

ASUS EeePc 900HA netbook  1.6 Ghz Atom CPU  1GB RAM
160 GB internal HD    Seagate 250 GB USB portable drive 
Intel ‎Mobile 945GSE Integrated Graphics Controller
Atheros AR242x/AR542x Wireless Network Adapter
Intel (N10/ICH7 Family) High Definition Audio
Dynex 5-Button Wired Optical Mouse
LXDE

Online Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11542
  • ----IOFLU----
Re: UUID
« Reply #3 on: October 06, 2010, 03:56:52 PM »
blkid maybe?
http://linux.die.net/man/8/blkid





That one only displays, doesn't look like it will change a xfs UUID.  Just read it.


Cheers,

Patrick013




Do you have the xfsprogs package installed? Have you tried labeling the partitions, and using the labels rather than UUID numbers to identify the partitions?

A far better way to replicate an OS is to format the receiving partition, then use rsync to transfer the actual data. In this manner the UUID of the receiving partition will be unique, as it should be, while the transferred data will be a bit perfect copy of the original.
« Last Edit: October 06, 2010, 03:58:48 PM by old-polack »
Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...

Offline Yankee

  • Hero Member
  • *****
  • Posts: 1475
  • In theory, theory=practice, in practice ???
Re: UUID
« Reply #4 on: October 06, 2010, 05:02:05 PM »
blkid maybe?
http://linux.die.net/man/8/blkid





That one only displays, doesn't look like it will change a xfs UUID.  Just read it.


Cheers,

Patrick013




Do you have the xfsprogs package installed? Have you tried labeling the partitions, and using the labels rather than UUID numbers to identify the partitions?

A far better way to replicate an OS is to format the receiving partition, then use rsync to transfer the actual data. In this manner the UUID of the receiving partition will be unique, as it should be, while the transferred data will be a bit perfect copy of the original.


Yes the xfsprogs package is installed.  The labels need the xfs admin program too to use labels for
partition id if I remember right from researching last night.  I'm not familiar with rsync but at first read it looks like it is for file transfer, my fsarchiver partition archives have partition header, partition files, all set to go to the target drive partition for booting, of course.  Rsync looks like it would work if the header was bootable.  Doesn't say otherwise.

What you are saying is type rsync /dev/driveA to /dev/driveB and boot then ?   If so it's a great command with the proper syntax.  I wonder if it would work if you're on driveA?   But it's not a backup archive program.  I'll have to read up on this one.

Correct me on the above if necessary.   Thanks for sharing the rsync command.


Cheers,

Patrick013


ASUS EeePc 900HA netbook  1.6 Ghz Atom CPU  1GB RAM
160 GB internal HD    Seagate 250 GB USB portable drive 
Intel ‎Mobile 945GSE Integrated Graphics Controller
Atheros AR242x/AR542x Wireless Network Adapter
Intel (N10/ICH7 Family) High Definition Audio
Dynex 5-Button Wired Optical Mouse
LXDE

Online Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11542
  • ----IOFLU----
Re: UUID
« Reply #5 on: October 06, 2010, 07:34:09 PM »

What you are saying is type rsync /dev/driveA to /dev/driveB and boot then ?   If so it's a great command with the proper syntax.  I wonder if it would work if you're on driveA?   But it's not a backup archive program.  I'll have to read up on this one.

Correct me on the above if necessary.   Thanks for sharing the rsync command.


Cheers,

Patrick013


For background, I only use ext3 or ext4 partitions for my OS, because both are stable, robust, excellent for general file handling such as that found in a / partition, and all necessary filesystem tools are readily available.

I have numerous copied OS on this machine. I always partition, and format those partitions, prior to installing or copying any OS. When copying an OS, I do this from another running OS, not the one being copied, so that all data to be copied is in a non running state. (This can be a liveCD if you only have one installed OS) I mount the partition to be copied on /mnt/here and the receiving partition on /mnt/there. (I always copy from here, to there)

As root, the command couldn't be simpler;

[root@localhost ~]# rsync -av /mnt/here/ /mnt/there                <Enter>

The -av argument makes sure all files are bit perfect copies, with the v part giving verbose feedback of the process, as it progresses. Note the trailing / after the source partition, /mnt/here/. Without the trailing / the copied data would be in a directory named here. With the trailing / only the contents of the partition mounted there are copied, without the mount point directory, Part of the beauty of this method is that the copied partition and the receiving partition can have different file system formats. You could copy from your present xfs partition to an ext4 partition and still have a runnable copy. Very useful if you simply wish to change file systems without having to reinstall.

When the copy is complete, the /etc/fstab of the copy has to be edited to reflect the new location of its / partition.

[root@localhost ~]# kwrite /mnt/there/etc/fstab                <Enter>

Edit as needed and save the file.

A stanza pointing to the new / partition must also be added to the master /boot/grub/menu.lst if the OS is to be operated on the same machine. If the hard drive is to be moved to another machine, the boot stanza in the copy's /boot/grub/menu.lst must be edited to reflect the change of location, then grub must be installed to the MBR of that drive, using the new / partition as the root (hdx,n) entry.

[root@localhost ~]# kwrite /mnt/there/boot/grub/menu.lst                <Enter>

Edit as needed and save the file. If this is to be a boot drive, all references to the drive must be as (hd0) in grub notation. If UUID numbers are used, the correct UUID for the new / partition can be found with the blkid command. I label all my partitions, and use the labels, as they are easier to remember than UUID numbers when doing these edits to system files.

Examples:

My boot stanza for this installation as originally installed.

title MiniMe 2010
kernel (hd2,13)/boot/vmlinuz BOOT_IMAGE=MiniMe_2010 root=LABEL=minime2010 resume=LABEL=swap1000 vga=791
initrd (hd2,13)/boot/initrd.img


The boot stanza for this installation as it would appear in the boot partition's master menu.lst on this drive, if I were to use it to actually boot the OS from it's own partition,

title MiniMe 2010
kernel (hd0,13)/boot/vmlinuz BOOT_IMAGE=MiniMe_2010 root=LABEL=minime2010 resume=LABEL=swap1000 vga=791
initrd (hd0,13)/boot/initrd.img


The boot stanza for this installation as it actually appears in the boot partition's master menu.lst on all installed drives, that I actually use to boot the OS from the boot partition itself.

title MiniMe 2010
kernel (hd0,0)/minime2010/vmlinuz BOOT_IMAGE=MiniMe_2010 root=LABEL=minime2010 resume=LABEL=swap1000 vga=791
initrd (hd0,0)/minime2010/initrd.img


Note: Where a partition is being booted from, and where the kernel being used is located, is always relevant to which drive is the current boot drive on a multi-drive machine. By having a small boot partition on each drive, all containing the exact same thing, (another rsync copy) allows the use of the last stanza shown above to work from whichever drive is designated the current boot drive.

My fstab:
Code: [Select]
LABEL=minime2010        /                       ext4    defaults,noatime                1 1
LABEL=TR5-Documents     /home/polack/Documents  ext3    rw,user,noauto,exec,noatime     0 0
LABEL=Documents2        /home/polack/Documents2 ext3    rw,user,noauto,exec,noatime     0 0
LABEL=share7            /share7                 ext3    rw,user,auto,exec,noatime       0 0
LABEL=share9            /share9                 ext3    rw,user,auto,exec,noatime       0 0
LABEL=movies            /movies                 ext3    rw,user,auto,exec,noatime       0 0
LABEL=movies2           /movies2                ext3    rw,user,auto,exec,noatime       0 0
LABEL=TV-1              /tv                     ext3    rw,user,auto,exec,noatime       0 0
LABEL=storage00         /zstorage00             ext3    rw,user,noauto,exec,noatime     0 0
LABEL=120backup         /zbackup                ext3    rw,user,noauto,exec,noatime     0 0
LABEL=boot200           /mnt/boot               ext3    rw,user,noauto,exec,noatime     0 0
none                    /proc                   proc    defaults                        0 0
# Entry for /dev/sda2 :
LABEL=swap200           swap                    swap    sw,pri=3                        0 0
# Entry for /dev/sdc2 :
LABEL=swap1000          swap                    swap    sw,pri=3                        0 0
# Entry for /dev/sde2 :
LABEL=swap750           swap                    swap    sw,pri=3                        0 0
none                    /dev/pts                devpts  mode=0620                       0 0
/dev/fd0                /mnt/floppy             auto    rw,user,noauto,exec             0 0
/dev/sr0                /mnt/cdrom              auto    ro,user,noauto                  0 0
/dev/sr1                /mnt/dvd                auto    ro,user,noauto                  0 0
# none                  /dev/shm                tmpfs   defaults                        0 0

By changing only the label name of the top line, I can use this same fstab in all Linux OS on this machine, so that no matter which OS is running, all my data is found in the same relative place.
Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...

Offline Yankee

  • Hero Member
  • *****
  • Posts: 1475
  • In theory, theory=practice, in practice ???
Re: UUID
« Reply #6 on: October 07, 2010, 06:05:22 PM »

Hi old-polack,

Thanks for the manual on rsync here.  Copied and saved for future reference.
Editting boot files and installing grub in Linux is very fresh for me so I need to stay with
fsarchiver for the present.  Running rsync other than that I understand.   Just
have to avoid a UUID problem in the future.

Ext4 is actually Google's choice for new filesystem over XFS.  Ease of conversion
was their reason, really didn't need the extra capacity obviously, and other per-
formance qualities were equal they said.  Ext4 does do block journaling while xfs
does not, and are close in speed for various operations. 

I'll ask in package request for "xfs admin" in case I need it in the future.  I'm not
unhappy with fsarchiver.  It's making good archives and restores very well.   I
think we're the only place that has it in repo other than on SystemRescueCD.

Thanks for the reply and the above info.


Cheers,

Patrick013

ASUS EeePc 900HA netbook  1.6 Ghz Atom CPU  1GB RAM
160 GB internal HD    Seagate 250 GB USB portable drive 
Intel ‎Mobile 945GSE Integrated Graphics Controller
Atheros AR242x/AR542x Wireless Network Adapter
Intel (N10/ICH7 Family) High Definition Audio
Dynex 5-Button Wired Optical Mouse
LXDE