Linux - GeneralThis 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
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.
Location: Margaritaville (a state of mind west of Las Vegas), NV
Distribution: Linux Mint
Posts: 61
Rep:
Restore disk img without overwriting entire disk?
I'm upgrading a Windows system drive. I've created a disk image (using Disks) of the old 256GB drive and I want to write it to the new 1TB drive. But I'd like to not overwrite a partition at the end of the drive. There's plenty of room at the beginning of the drive. I just need a little advice on how to do the restore without stepping on that partition.
I don't use Gnome disks for backups but it looks like it clones/restores the entire drive. If it is a byte for byte image you can try mounting a partition from the image and copy the desired files to a filesystem on the new drive.
I'm guessing the OP wants to just slap the image back down - partition table, boot loader and all. Windows being windows, there are licensing issues potentially on the horizon.
That should work, but the big drive will look just like the little drive - including its (total) size. That can be fixed, but I've never tried to since before the invention of gpt. The filesystem at the end of the new drive should survive (is it linux ?), but you'll have to redefine the partition precisely to get it to mount.
Just backup the partition on the new drive, use windows own system backup/restore tool, resize partitions in need, and restore the mystery filesystem. Gotta be safer.
It will nuke the old partition table on the new disk. That will make the filesystem in that (ex-)partition unreachable. But intact, so the data will still be there. Simply (!!!!) defining a new partition at the correct sector will bring it magically back to life.
sfdisk is the tool of choice here - read the manpage, then use it to dump both disks before you start meddling. Keep the output safe.
After the restore, use gdisk to fix up the new disk to its real size, then feed the line that defined the original mystery partition back in to sfdisk to redefine the partition correctly - see the examples at the end of the manpage.
Pondering your present situation ... and given that it is Windows ... my initial guess is that you could carve out a new partition and restore the .img file onto that. Then, use whatever features your present-Windows might offer for "restoring from a previous system." Point it – if you can – to that restored partition, and hope that the programmers in Redmond were thinking as you do.
Otherwise: what if you purchased "a brand-new external drive" at your local office-supply store, restored the image onto that, and presented it to Windows as "the hard-disk from the previous system?" ("It" being "an actual disk drive.")
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,803
Rep:
Quote:
Originally Posted by sundialsvcs
Otherwise: what if you purchased "a brand-new external drive" at your local office-supply store, restored the image onto that, and presented it to Windows as "the hard-disk from the previous system?" ("It" being "an actual disk drive.")
I once got into a situation where I was required to call Microsoft for a new authorization key... simply because I added a second drive to a previously working system used by my daughters and spouse. It's insane that that would trigger another call to MS support (and the time off work to deal with that bunch) but there ya go. I would be surprised to find that installing a new disk and moving Windows onto it didn't trigger the same problem.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.