cpradio's tidbits of information a one stop spot for my personal references

2Jul/05Off

Reunion, Clone, and a Bug Fix

Today, was a busy day. I woke up around 10:30 AM and so I did what I usually do and tried to go back to sleep but that never happened. So, I got up and read a few posts on the cpCommerce Forums and came across a bug dealing with the shipping zip code. I probably spent 2 or more hours trying to figure out why this bug was occuring and finally it HIT ME. The bug existed due to a change I had made to the account_info.func.php file which loaded the user's zip code information into the session variable everytime their login information was checked. DUH! Of course, that will overwrite any checkout value the user then later on types out. I am just glad I got it resolved.

Following the bug fix, my grandparents came down and told me they had finished the work they needed to do on the Conference Computer, so I could now make a clone of its hard drive. They wanted a clone of it made, as they plan to do a major software upgrade on it and do not want to lose all of the data they have. I must admit, I am in love with the NTFS tools Linux has. It didn't take me long to make another hard drive (one that is larger in size) work exactly the same as the old hard drive.

To start out, I first needed to make an image of the conference computer's current hard drive. This can done by running the following command:

# ntfsclone -s -o /media/software/backup.img /dev/hdc1

Now, the "-s" stands for "Save Image", the "-o" is for the output image path and filename, and then the whole command ends with the partition on the hard drive you want to backup/clone. Following this step, I then made a copy of the MBR (Master Boot Record) and of the Partition Table, so my cloned hard drive would have the exact same configuration as the original. To make a copy of the MBR and the Partition Table, I did the following commands:

# sfdisk -d /dev/hdc > /media/software/master-hdc.dump
# dd if=/dev/hdc bs=512 count=1 of=/media/software/master-hdc.mbr

Now, I used the command sfdisk to do this and the first command makes the partition table and the second of course writes the copy of the MBR. Now the only part left, is to write all of this data to the new hard drive so I can have a clone. To do this, I simply ran the following commands:

# sfdisk /dev/hdc < /media/software/master-hdc.dump --force
# dd if=/media/software/master-hdc.mbr of=/dev/hdb
# ntfsclone --restore-image --overwrite /dev/hdb1 /media/software/backup.img

The first command write the partition table to the new hard drive and I had to use --force as my hard drive already had a partition table, however, you may want to use --force just for precaution The second command, write the MBR to the new hard drive which is needed if you wish to boot this hard drive. Finally, the ntfsclone command is used to write the image we made earlier to the clone hard drive, this way we have two hard drives that have the same exact data. How sweet is that! All of this took less than 20 minutes to do on a 40 GB NTFS formatted hard drive and cloning it to a 60 GB NTFS formatted hard drive.

Finally, my day ended with going with Kami to her high school's 5 year reunion. IT COMPLETELY SUCKED! First of all, why bother going to a high school reunion? I know this is popular in small towns, but what is with the need to see old school mates and gossip about those who did not show up? Kami agreed afterwards, that is was boring and not worth it, but she wanted to attended so at least she gave it a shot. I admire that, but it kills me to attend these type of events, as I feel like an outcast. People are chatting away about people I know nothing about and no one explains to me who these people are... Then of course, we get back to my place and my grandparents have to make the whole thing worse by bringing it all up again!

It was already excruciating enough, just let it be! I will not attend one of these again for the rest of my life. They are flat out horrible and pointless for me to be there. The only real reason for me being there was for Kami's arm candy...or at least that is the feeling I got from it all. Everyone knows the saying: "A picture is worth a thousand words". Well, let me tell you this, if that is true, a picture would have said a whole lot more than I did AND I WAS THERE IN PERSON!

After all of that hoopla, we went to lock up the church and to let the dogs out, then I went home and watched "The Last Castle".

Comments (0) Trackbacks (0)

Sorry, the comment form is closed at this time.

Trackbacks are disabled.