LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 04-21-2009, 09:56 AM   #1
taylorkh
Senior Member
 
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6, CentOS 7 (with Mate), Ubuntu 16.04 Mate
Posts: 2,127

Rep: Reputation: 174Reputation: 174
Angry UUIDs and the best laid plans...


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?

TIA,

Ken
 
Old 04-21-2009, 10:11 AM   #2
kentyler
Member
 
Registered: Dec 2008
Location: Newark Ohio
Distribution: Fedora Core
Posts: 270

Rep: Reputation: 38
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.
 
Old 04-21-2009, 10:16 AM   #3
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
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.
 
Old 04-21-2009, 10:44 AM   #4
taylorkh
Senior Member
 
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6, CentOS 7 (with Mate), Ubuntu 16.04 Mate
Posts: 2,127

Original Poster
Rep: Reputation: 174Reputation: 174
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.

Thanks again all!

Ken
 
Old 04-21-2009, 08:51 PM   #5
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
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.

Last edited by jschiwal; 04-21-2009 at 08:56 PM.
 
Old 04-22-2009, 06:56 AM   #6
tommcd
Senior Member
 
Registered: Jun 2006
Location: Philadelphia PA USA
Distribution: Lubuntu, Slackware
Posts: 2,230

Rep: Reputation: 293Reputation: 293Reputation: 293
You may want to check out Clonezilla for cloning your hard drive partitions:
http://clonezilla.org/
Here are some videos from the Linux Action Show podcast about Clonezilla:
http://www.jupiterbroadcasting.com/?p=567
http://www.jupiterbroadcasting.com/?p=581
 
Old 04-22-2009, 07:31 AM   #7
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,119

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
"man uuidgen"

Personally I never use UUID, or imaging tools.
 
  


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
Problem using UUIDs Aldeb Linux - Hardware 11 10-27-2008 10:27 AM
LXer: What UUIDs can do for you LXer Syndicated Linux News 0 09-11-2008 03:40 PM
Can Ubuntu 7.10 be run without UUIDs? taylorkh Ubuntu 5 04-28-2008 12:23 PM
New user, laid off tech. Been doing contract work since being laid off by Getronics. inet77dean LinuxQuestions.org Member Intro 1 01-25-2007 04:41 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 12:52 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