Moved OS to new hard drive, now partition info is all messed up.
Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with 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.
Moved OS to new hard drive, now partition info is all messed up.
Hello, I moved my ubuntu install to a new 1TB hard drive. I setup a 15GB partition for boot, a 1.5GB partition for swap, another 15GB partition which i use as a backup of my main partition, and the rest (900GB) for storage.
I used partimage to duplicate my main partition from the old drive over to this new one. The rest of the partitions i formatted but left blank.
I ran into a couple of problems getting it to boot off the new drive, and i realized i needed to copy the mbr over, so i used the DD command to do this.
Something went wrong. Now, when i open gparted up, it sees a 700GB partition as the boot partition, and 200+ GB of unformatted. However, if i do a df -h command, it sees 15GB total with 7+ being used.
I'm not sure what i should do to correct this other than redo the whole process of copying the original partition. Any ideas? Is there a simple fix i can do?
-Thanks
As you I am really lost what you did. the dd command is very powerful. Things to do when copping a system.
there are programs that do this but I use puppy linux.
I put puppy in and boot into ram click on my hard drive I want to copy then click so it shows all hidden folders. then copy the system over to the drive how the major tree folder system. you know bin,boot,dev,etc,home,lib,media,mnt,opt,proc,etc etc.
after you coppied the tree you need to go to your new copy and change your /etc/fstab file so the location of your drive will boot.
Then use puppy to put a grub on your mbr then edit the /boot/grub/menu.1st file to boot according to your fstab file that is in sink with your system.
make sure you put the mbr on the new drive ok.
This may seam to be a harder way to do thing but not always do I want to copy everything over.
I am sure there is plenty of image programs to do this for you but theses steps have never let me down.
step one make the image copy
step two change the fstab to sync with system
step three use the grub or lilo to put the master boot record on the drive
step four boot system and look for errors if any.
It is impossible for me to know what you typed on your dd command but if you did not select the dd if=mbr.hda.25815 of=/dev/hda bs=512 count=1
My /boot/grub has this file in it(mbr.hda.25815) that is an image of my mbr that is then written to the hda but if your new drive is seen as sdb then you will have to do sdb then.
When you partition you must set the new drive to boot first. this creates a space on the first sector of the drive. for the mbr.
Good luck
Start again.
- don't use partimage. If source and target partitions are (exactly) the same size maybe you can. Maybe.
- don't use dd on the MBR.
Create partitions on the target drive, and mkfs (or mkswap) filesystems on those (new) partitions. Then use "cp -a ..." (or rsync or similar) from a liveCD to copy each (non swap) partition in turn.
Then fix your bootloader and fstab (in need).
So basically do i need to just re-do the process? is there no way to fix this? (this is an htpc and it's a little drama to go switching the drives in and out because of the setup, that's why i want to try to repair the partition table if possible)
Also, why not use partimage, isn't that what it is designed for?
In the end, what i want to do is create a script or two so that i can boot into my backup partition and image the primary partition to a backup file, then reboot back into my primary partition and use that image to replace the backup partition. This way i always have a backup partition that is fairly up to date. I've been using partimage to do this and it's worked fine so far, but this time, i'm not sure what went wrong.
OK, i went ahead and tried partimage a second time and this time it worked just fine. However, in gparted, it says my root partition is also mounted to /dev/.static/dev or something like that as well as being mounted to /.
Any ideas why this is, or should i start a new post? I am able to just umount that location, but that's kinda weird that it keeps remounting it upon boot.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.