LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-09-2014, 07:20 AM   #1
RedGreenBlue
LQ Newbie
 
Registered: Jan 2014
Posts: 1

Rep: Reputation: Disabled
Re-imaging hard disk, strange problem with UUID and permissions


Some time ago, I backed up my entire 250 GB hard disk to a file. Like so:

Code:
dd if=/dev/sda of=/mnt/external_hard_disk/backup.data
Later, I then took this huge 250 GB file and copied it to another 250 GB hard disk, as follows:

Code:
dd if=/mnt/extrnal_hard_disk/backup of=/dev/sda
I then tried to boot this hard disk, but the first problem was that Grub couldn't locate the appropriate partition to boot from because the UUID of the partition was different.

I was under the impression that the UUID's of any ext3 partitions would have been stored within the image file (because I took an image of the entire hard disk), so I'm at a loss to explain this.

I edited the entry in Grub by pressing "e" and I changed the UUID to simply "/dev/sda" and then Ubuntu Linux 12.04 LTS booted up just fine. However, there's a problem: All the file permissions are altered... every single file, directory and symbolic link on the partition is owned by "root:root". Again I'm at a loss to explain this.

Anyone?
 
Old 01-09-2014, 06:30 PM   #2
enorbet
Senior Member
 
Registered: Jun 2003
Location: Virginia
Distribution: Slackware = Main OpSys
Posts: 4,776

Rep: Reputation: 4425Reputation: 4425Reputation: 4425Reputation: 4425Reputation: 4425Reputation: 4425Reputation: 4425Reputation: 4425Reputation: 4425Reputation: 4425Reputation: 4425
Quote:
Originally Posted by RedGreenBlue View Post
Some time ago, I backed up my entire 250 GB hard disk to a file. Like so:

Code:
dd if=/dev/sda of=/mnt/external_hard_disk/backup.data
Later, I then took this huge 250 GB file and copied it to another 250 GB hard disk, as follows:

Code:
dd if=/mnt/extrnal_hard_disk/backup of=/dev/sda
I then tried to boot this hard disk, but the first problem was that Grub couldn't locate the appropriate partition to boot from because the UUID of the partition was different.

I was under the impression that the UUID's of any ext3 partitions would have been stored within the image file (because I took an image of the entire hard disk), so I'm at a loss to explain this.

I edited the entry in Grub by pressing "e" and I changed the UUID to simply "/dev/sda" and then Ubuntu Linux 12.04 LTS booted up just fine. However, there's a problem: All the file permissions are altered... every single file, directory and symbolic link on the partition is owned by "root:root". Again I'm at a loss to explain this.

Anyone?
I hope this can help since I don't nor haven't used "dd" for much except USB sticks, preferring "cpio" or "rsync".

Quote:
from LinuxMafia

5. "dd": This utility is included here mainly to warn that it is usually the wrong tool. It does bit-by-bit copies of raw devices, which is useful where (e.g.) you want to copy an image of a floppy disk to a file, or vice-versa. Please note that there is no attempt to map around bad sectors on physical media. You could use it to clone one (unmounted) filesystem to the corresponding physical space on a different disk, provided that the disks have identical disk geometry. Otherwise, use one of the other methods.

Syntax: "dd if=/dev/olddevice of=/dev/newdevice"

Here, "if" denotes input file. It might be specified as /dev/sdb1, for example.

"of" denotes output file, e.g., /dev/sdc1
I'm most fond of "rsync" since it does checksums, preserves symlinks, and can do incrementals, etc, but recently I read this and found it interesting and plan to play with it some, CPIO Backup/Restore

I'm not fond of UUID and expect to grow less fond of it on the systems I use that insist on "upgrading" to ever more systemd implementation. It seems to me that while there may have existed a problem during the transition away from PATA IDE to SATA (/dev/hdx vs/ /dev/sdx) now that all modern motherboards are SAS or SATA and will be for the forseeable future, I don't see the advantage of UUID and it does have it's problems.

I sincerely hope your "of" still exists so that this post can be of some service now and not just for the future. Whether "rsync" or "cpio", I think you will find it more useful, if only by virtue of being fine-tunable by switches for different types of jobs. Best wishes
 
Old 01-11-2014, 02:19 PM   #3
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,937

Rep: Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619Reputation: 3619
The uuid deal is common. Either make it generic in grub and fstab before the clone or fix it later.


As to permissions, not sure. Maybe a bad copy or somehow boot is different. Usually when you boot to a live cd the disk is set all to root. Seems to be what is going on with you but I can't explain why.

Guess if you still have the image you could boot it with qemu to see if it has correct permissions on the image.

Consider using compression when making such a huge file. dd pipes well to gzip (can set compression level 1-9??).
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How to mount by-uuid if the device won't show in /dev/disk/by-uuid untill after blkid /dev/sd* ? masmddr Linux - General 4 01-10-2011 07:38 PM
Volume has problems including no uuid in /dev/disk/by-uuid abejarano Linux - Hardware 3 12-31-2008 08:41 PM
I very strange hard disk problem with OpenSolaris 2008.05 on a Sun Ultra 20 M2 crisostomo_enrico Solaris / OpenSolaris 4 05-16-2008 04:57 AM
Hard disk imaging bharath_neo Linux - Software 2 07-31-2007 12:59 PM
Hard Disk Imaging software neouto General 6 09-07-2005 07:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:24 PM.

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