Just would like to share my experience with moving my FreeBSD r10.1 p6 system over to another hard drive. Thanks to FreeBSD Manual 8.2, Warren Block (Backup Options for FreeBSD), and my previous poster Chris_H.
This all started after "Windows update" crashed out my Windows 7 boot. Just google it. Hundreds of them, all with the same sob story. So I was faced with rebuilding my Windows 7 drive. I use Windows 7, only, for my Garmin device, programing PLC's, commissioning drives, and Adobe Professional, and a ScanMaker 4900 scanner not supported by FreeBSD. I actually thought my hard drive failed because after I re-installed Windows for the "SECOND" time it crashed out at boot time again, after attempting to eat yet another update, and this happened, after being fully updated again, or so I thought. I purchased another 1T hard drive because it just had to be a hard disk failure right? Wrong! When the new hard drive crashed out on me again after windows updates did whatever, I put my BSD drive back in and started googling. I was really shocked by what I found which is, 1) there is no resolution to this problem yet 2) some updates fail because users are using there computers to boot other operating systems. Imagine that. 3) at the time my problems started I was using that drive in single boot mode only, and had never dual booted with it. 4) I have turned windows update off until such time I get contacted from planet X by a MS professional telling me to go ahead and turn them on again. Ha! Good luck with that. 5) Now in there ever increasing paranoia MS have decided to not offer images of operating systems to users so that they can perform clean installs. If you want to do that you now have to buy an operating system from Micro Soft on top of the one loaded with bloat ware that you get when you purchase a new computer. Check it out. Its really true. I cant believe it. Are they not wallowing in enough cash yet? >>>>>> Good things are about to happen.
Put new hard drive inside laptop. Nuke'n boot new hard drive. I reinstalled Windows 7 for the 4th time and did only one round of updates. Turn off windows updates. I used the Lenovo "Restore DVD's" as it gets all the drivers installed correctly. Lenovo along with Windows use x4 partitions to get x1 operating system up and running. Windows 7 has a boot managed MBR partition on this machine and the bios does not support UEFI and windows can not use GPT without a UEFI bios. You need both for Windows 7. Lah-t-dah! I partitioned the drive before the Windows install but Windows took the whole drive anyways even after it appeared as if the installer pointed it to the 1st partition. Need I say more about 2nd party vendor software? DONE WITH WINDOWS. Delete the third (extended) partition. Shrink the second partition. Delete any formatting and file systems on the unused partition. Leave as unused space. I'm not good enough to
fdisk
this unused space so I just use my FreeBSD 10.1 image and do an install and manually create my FreeBSD slice
ada0s3 which the FreeBSD installer is intelligent enough to sniff out and use the unused space located between two existing partitions. Perfectly I might add. How nice is that? Create the other partitions and complete the install. Reboot back into single user mode (SUM) and using boot easy put the boot code on the windows boot partition. Now to move partitions from existing (been working on this one since Nov, 2014) FreeBSD 10.1 system drive to newly created partitions on new hard drive.
Physical arrangement as follows: new drive cabled into machine and original drive inside machine. Boot into SUM and
Code:
# mount -u /
# mount -at ufs
# cd /dev
Take note of your partition arrangement. Mount them, check them, and make sure you know what's what. In my case the FreeBSD slice is
/dev/da0s3. That's the case here because the two slices ahead of this one are for Windows. If you have done previouse backups using dump on your original file system then go ahead and delete the time stamps of the dumps in
/etc/dumpdates. This insures that you will get ALL the data and also you will avoid FreeBSD complaining about symmetrical links it can't find. This is because I'm using a live file system and not dumping from a restore which would have the symlinks in the root path, I believe. This is the way I had to dump my
/usr partition, exactly:
Code:
# umount /mnt
# cd /
# mount /dev/da0s3f /mnt
# dump -c16 -b64 -0uanL -h0 -f - /dev/ufs/hmusrfs | (cd /mnt && restore -ruf -)
Repeat the
umount /mnt
as many times as needed to make sure nothing is mounted. That last line looks a bit strange. The partitions on my original drive are labeled. The partitions all that data is going into are not. I will explain in a minute. I tried using
/dev/ada0s1f but I got an error. Can't exactly remember what the number was. Just remember I am dumping a live file system from labeled partitions to an unlabeled file system on new drive. Go ahead and finish the dumps
/var,
/tmp,
/. 1hr 24 mins for me. Not bad really. I think its definitely faster than an image. Swap out drives, reboot, and epic fail (no boot device found). That's because
etc/fstab is now the fstab from the original drive (the one with the labeled partitions). Open CD bay, insert FreeBSD 10.1 image and boot into SUM and mount your root partition:
Code:
# mount /dev/ada0s3a /mnt
Edit
/etc/fstab. I commented out the labeled file system lines and entered new file system layout, which of course reflects this installation. Then
reboot
into a carbon copy of what you have been using (exactly) save for the file system which is 10 minutes tops. That's the only adjustment (so far) that's required, and I'm sure that there is a better way.
I now have an extra 1T, and 750GB spare SATA drives. I'll use the 1T to image my existing dual boot 1T and put the 750GB into full experimental mode. There is good in almost everything. Thanks again to everyone that helped.