UbuntuThis forum is for the discussion of Ubuntu Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I just upgraded my "server" from 1 - 160 GB PATA and 2 - 320 GB SATA drives to 2 - 1 TB SATA drives. It is strictly a backup device for bulk storage of files via Samba and ssh. No other server services. Originally the PATA drive was for the OS and some storage and the 2 SATA drives for data only. Here is my new layout:
sda1 6 GB mounted as /
sda2 1 GB swap
sda3 all the reset mounted as /data1
sdb1 6 GB not mounted (reserved for OS backup)
sdb2 1 GB swap
sdb3 all the reset mounted as /data2
My grand plan was to use sdb1 to hold a mirror copy of the OS so that in the event of a failure of the OS on sda I could simply swap the SATA cables and boot from the second drive. Some data will be mirrored between /data1 and /data2 but most will reside on only 1 drive as it is stored elsewhere and is on the "server" only for the convenience of having it on-line.
So I installed Ubuntu 8.04.2, updated and configured everything and loaded my data. As I do not like UUIDs, at least on fixed disks, I removed all UUID references from fstab and Grub's menu.lst. All worked fine.
I then used g4l to clone sda1 to sdb1. When I booted the machine fsdsk barfed and produced a log saying that sdb1 was already mounted and could not be checked.
It seems that g4l (basically a menu wrapper around dd as I understand it) also cloned the UUID of the partition. So now I have 2 partitions with the same UUID and Linux is not happy.
My fallback plan is to make a g4l image of sda1 and store it on DVD to be installed on sdb1 if the need ever arises. Still, it would be nice to be able to keep the backup OS on the second drive and ready to go. So I guess I will ask...
1 - Is there a way to do away with UUIDs completely?
2 - Is there a cloning tool which will not clone the UUID?
You could mount with the fstab using the device names not labels.
to clone the drives and partitions you could cat /dev/sda > /dev/sdb or use dd.
This of course assumes you have the same size drives or you would need to use fips or something to recover the unused extra space if any on the target.
If you want a clone of the drive for redundancy why not use RAID 1. If one of the drives goes bad, the system will still run on the other. Then swapping the cables won't be necessary and you have time to replace it.
Also, depending on the filesystem, you may be able to change the UUID. For ext3, use `tune2fs -U random|time device' to change the UUID to one that is either random or based on the time.
Thanks kentyler - I have already modified fstab to use device names rather than UUIDs. I will give cat and dd a look. I only wish to clone the first partition sda1 to sdb1 so I will triple check the syntax first.
Thanks jschiwal - The partitions are ext3 so I will give the tune2fs approach to changing the UUID a try. I do not really need/want RAID 1 as only the first partition need to be cloned. /sda3 and /sdb3 will contain different data. Unless I can RAID only a pair of partitions(?) Haven't played with RAID since NT 3.51 and never in Linux. I may give it a look as well.
Yes, with linux raid you can use pair of partitions (/dev/sda1, /dev/sdb1) of equal sizes while using /dev/sda2, /dev/sdb2, etc. as regular partitions.
I don't use Ubuntu, but you may be able to configure it using it's partitioner program. Create two partitions and make them of type Linux RAID. (Might be called "File System ID")
The in the raid configuration, select RAID-1 and add those two partitions. Then opt to format the raid partition (the device will probably be /dev/md0) with the Linux filesystem of your choice.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.