Clone Win7 to SSD and fix boot with BCDedit

May 18, 2013

Existing setup: dual boot Win7 / Ubuntu on old 64GB SSD drive (dev/sda1 and dev/sda2). Out of space. Want to move Win7 to its own 128GB SSD and delete the old win7 from the 64GB SSD, so that becomes the dedicated ubuntu drive.

The new 128GB SSD is installed as dev/sdc1.

Boot into Ubuntu normally. Run GParted, format the new SSD to NTFS, allow 1MB before the partition for correct sector alignment (select MiB, not Cylinders).

Download Clonezilla Live CD, add it to your bootable USB using Multisystem USB creator. Reboot into the live USB. Follow directions for Clonezilla partition to partition. Took about 5 minutes to complete.

Boot back into ubuntu, open a terminal, run “sudo update-grub” and it will find the new win7 (on /dev/sdc1) install and place it alongside the prior win7 (on /dev/sda1)  in the grub bootloader selector. Note that I still have both drives connected in the case.

When reboot, I choose the Win7 on /dev/sdc1 (the new one), and it magically boots with no problems! But it’s too good to be true… it’s actually booted into the old Win7. It turns out that the bootloader in the cloned win7 is still pointing at the original device.

Note, on this computer
/dev/sda1 in ubuntu is actually the C: drive in Windows.
/dev/sdc1 in ubuntu is actually the E: drive in Windows.

Summary:
Old win7 on /dev/sda1 is booting device=C:
New win7 on /dev/sdc1 is also booting device=C: (but the new win7 is on E:).

We need to use bcdedit to change C: to E: in the new win7 clone.

So… boot into the original Win7, run the cmd terminal as Administrator.

List the bootloader setup on the C: drive
“bcdedit /store C:\boot\BCD /enum”

bcdedit-c

 

List the bootloader setup on the E: drive looks exactly the same.
“bcdedit /store E:\boot\BCD /enum”

How to edit:

“bcdedit /store E:\boot\BCD /set {bootmgr} device partition=E:”
“bcdedit /store E:\boot\BCD /set {default} device partition=E:”
“bcdedit /store E:\boot\BCD /set {default} osdevice partition=E:”

Recheck:
“bcdedit /store E:\boot\BCD /enum”

bcdedit-e

 

Reboot, select the new Win7 on /dev/sdc1 during grub menu.

 

Linking Access to an Exchange or Outlook Table – Mapi Tags and Schema.ini

May 23, 2007

This is basically a note to myself, because I did it a few years ago and have broken the table links. It’s no fun to find all the old documentation, so I’m noting the main points here.

Access 2000 uses the Jet IISAM to link an Access table to Outlook or Exchange. It generates a file called Schema.ini that basically tells IISAM what columns in the MAPI store will map to the columns in your linked table in Access.

Normally the schema.ini file is generated automatically, but if your MAPI table contains custom outlook forms, then these will break the linking between Access and Outlook (or Exchange). In this case, you need to modify the schema.ini file manually. There was a nice article about how to do this in Smart Access (Aug 2000) which Microsoft has reprinted here. There is reference to a second article which is more difficult to find called Accessing Exchange: Delving a Little Bit Deeper into the Jet 4.0 IISAM which describes how to use the MDBVUE.EXE tool, which I’ve summarized here with changes specific to my project.

Here is a typical schema.ini file that helps Access connect to a folder called Billing Contacts in the Public Folders:

[1 – Outlook – Billing Contacts]
IdSize=46
IdBytes=00 00 00 00 1A 44 73 90 AA 66 11 CD 9B C8 00 AA 00 2F C4 5A 03 80 85 13 1D 62 85 DE C9 40 93 7D B3 C9 B9 34 DC EA 00 00 00 00 FF 85 00 00
Col1=”Message Class” Char Width 510 Tag 1703966
Col2=Title Char Width 510 Tag 974585886
Col3=Account Char Width 510 Tag 7340062
Col4=”File As” Char Width 510 Tag -2120286178
Col5=”Home Address” Char Width 510 Tag -2137194466
Col6=”Business Address” Char Width 510
Col7=Phone Char Width 510
Col8=”Mobile Phone” Char Width 510
Col9=”Home Phone” Char Width 510

The article goes over the structure of the file, but the part I forgot was how to generate the “Tag” attribute for the non-standard fields. You actually need to dig into the guts of the MAPI store to find it.

“The Tag value in the Schema.ini file combines the DISPID of the column (a unique number that’s assigned to each column) in the top two bytes, and the datatype from Table 3 in the bottom two bytes.” (Table 3 is in the article, which is reproduced on Microsoft’s website but you don’t actually need the table, because MDBVUE will tell you the value.)

You then need to use MDBVUE.EXE tool from Microsoft to open the MAPI store and examine the DISPID and the DATATYPE directly.

One of the broken columns in my linked table was the “Home Address” column, which looked like this in the previous schema.ini file:

Col5=”Home Address” Char Width 510 Tag -2137194466

I needed to calculate the new Tag using the MDBVUE tool. After connecting to the store, open one of the actual items within the IPM folder (in this case one of the contacts withing Billing Contacts) and click on the Property Interface button, which opens another window. At the bottom of the window, select Hex. Find a row with what looks like a home address. The left column contains the DISPID (red circled in the screenshot, value is 0X8095) and the center column contains the datatype (red circled, value is 0X001E).

Screenshot of browsing an Item with MDBVUE Screenshot of Item Properties window in MDBVUE

Concatenated, these values are 0X8095001E and converting to signed long integer, this is -2137718754 . Note: you can convert using the Immediate Window in Visual Basic (open Access > Tools > Macro > Visual Basic Editor… then in the editor >View > Immediate Window, and type into the Immediate Window print &H8095001E and hit Enter to see the converted value.

 

So that row in the schema.ini file becomes:

Col5=”Home Address” Char Width 510 Tag -2137718754

 

Repeat with the other custom entries in the schema.ini file and save. The restart Access and open the linked table to see if it works.

 

Install 4 disks on a Dell sc440 – Yes it can be done

May 5, 2007

Bought a Dell PowerEdge sc440 server – bottom of the line but sufficient to host Exchange for a small office. Opened the case and noticed only 2 bays for hard drives, but the motherboard has 4 SATA connectors. What to do? Go into the BIOS and you see that it is possible to enable all 4 Disks, so you just need somewhere to mount them in the tower.

Time to get creative.

First of all, you don’t need a floppy, so if you ordered one with your server, take it out. You can fit a hard drive in there with a $10 adaptor.

Then, you also have room for a second optical drive… unless of course you bought the tape backup. Get a 5.25 to 3.5 inch adaptor to convert that extra optical bay.

Then just pick up a couple of SATA cables and power supply adaptor dongles and you’re good to go. I’ll post pics shortly.

Moving Exchange Server

April 29, 2007

Migrating from MS Exchange 2000 to 2003 this weekend, and thought I’d note a few of the not-so-obvious things I’ve come across. Hope it helps someone.

I built a small business network way back in 2001 to support a law practice, and the public folders on the MS Exchange 2000 Server are the hub of the case management, workflow, consultation scheduling. Because the end users felt comfortable using Outlook, it’s custom forms are basically the front end to all the other systems, including financials. It’s mission-critical, to say the least.

Like most small offices, we saved by purchasing one win2k server and making it do everything: domain controller, file server, exchange, etc., and with a handful of users, life was good and administration was simple. (we bought and stored an identical server offsite for disaster recovery).
Fast forward a few years, and the do-everything server is really grinding to fulfill its basic mission. I considered replacing the original server with a new Small Business Server 2003 setup.

Issue 1: SBS does not coexist with other domain controllers. Well, this actually is a myth, but I didn’t feel like messing with the AD, seizing FSMO roles. Plus why shove all the work on a single box again? But here’s how from Microsoft.

OK, so the plan was this:  get a second server, set it up as a member server for Exchange 2003, migrate the users’ mailboxes and mission-critical public folders.  Then decommission the Exchange 2000 server but retain it as the DC and fileserver.

We bought a Dell PowerEdge SC440 (what a deal), and I prepped it at home: installed Server 2k3 Standard and did not join to a domain. Brought it to the office and plopped on the network.  For a small organization, this can work, even thought the recommended hardware would consist of 6 or more disks: mirrored OS, mirrored logs, raid 5 exchange database.  SC440 only officially holds 2 disks, but has SATA connectors for 4.  Hmm.  Squeeze ’em into the empty floppy and second optical bay!  So OS and logs are on one disk set, with separate partitions, and Exchange database is on the second mirror set.  It’ll suffice.

Issue 2: it would not join the domain! Logged on locally as the Administrator, tried to join the domain with matching domain admin credentials, and get a goofy error such as “this account is not authorized to log in from this workstation.” Note: if your local admin account matches the domain admin account, just leave the credentials blank when it prompts you for them. Works.

Now I’m ready to install Exchange 2003 on the new box, right?  Sort of.  First you have to prepare the existing AD on all the other domain controller(s).  (BACK IT UP FIRST!).  The install walks you throug it: DNSdiag, Forestprep, Domainprep.  It was fairly painless.  There is an excellent reference here.  After the install, use Exchange System Manager to move the default Exchange database and log locations to the intended disks.

Exchange 2003 is in.  Now, how to get the folders over from the old Exchange 2000 server?  In ESM, it’s as simple as “move mailbox” to migrate the users.  The public folders have to be “replicated,” and this can take a while.  It’s doing this while I write.

Ubuntu performance tweaks

April 24, 2007

Ran across this blog post on Digg and thought it was worth a note.  As I’ve noticed that XP Home runs a bit faster than Xubuntu on one of my computers (a core 2 duo).  Maybe it just needs a little tweaking still.

Setting up Google hosted email under your own domain

March 24, 2007

I’ve decided to consolidate my email accounts and am attracted by the idea of outsourcing it all to a big, available company with lots ‘o bandwidth. Thinking Google Apps or Microsoft Office Live. With more than a handful of domains spread across a few web hosts — plus a bunch of personal email accounts, it’s tough to keep on top of them. Plus, I tend to abandon email addresses to keep a step ahead of spam.

For a while, I was impressed by the spam filters of Yahoo, but recently spam bots have been successfully bypassing their filters, since they send messages from individual users’ infected PCs. But that’s another topic…

Anyhow, I took a domain that wasn’t being used much immicom.com, and thought it would make a good test, because I didn’t have a mail server set up for it anywhere, and my friends have been raving about Gmail spam filtering, so:

Step 1: sign up for a Google account, sign in.

Step 2: go to Google Apps and indicate a domain you want to manage in Google Apps.

Step 3: select the free “basic” setup.

Step 4: indicate you want to use hosted email.

Step 5: Now it gets a bit more technical, because you have to change DNS server settings. It’s not so hard. DNS just tells all the other servers on the internet what “IP address” (just a unique number) matches your domain name. It’s kind of like calling 411 infomation to look up somebody’s phone number when you know their name but not their phone number. Computers need to do this each time you type in a website address.

First you need to know where your DNS server is and determine if you can access the DNS settings. Just go to your domain registrar (where you paid to get your domain), e.g. GoDaddy, networksolutions, whatever. If you don’t know, just got to whois.sc and type in your domain. They’ll tell you where your registrar, your website’s IP address, and also where your DNS servers are.

Step 6a: In case you can control your DNS settings. For example, if it is managed by your web host (the company hosts your website), usually they provide a web control panel to make DNS changes. Or if you manage the DNS in your own server. Just make the MX record changes in step 7.

Step 6b: In case you cannot control your DNS settings. You have the option of taking control of your DNS. This is what I had to do. How? By telling your domain registrar to point the world to a different DNS server that you can access. Most likely your domain registrar even offers DNS management that you can access as a value-added service at no extra charge. If so, sign up for it (all I had to do was click a YES box and they automatically pointed to their own DNS servers), and then add an A record to it like this, so it directs web traffic back to your web host, otherwise your website would cease to be available:

immicom.com. A 209.11.248.102 (and some other bits here)

Have you got any subdomains in use? If so, add a CNAME record to the DNS, for example the “subdomain” (www):

www CNAME immicom.com

Step 7: tell the world what server hosts your mail by adding or changing the MX records in your DNS, so it points at Google. Instructions here. These are the MX entries to add in your DNS settings:

MX Server address Priority
ASPMX.L.GOOGLE.COM. 1
ALT1.ASPMX.L.GOOGLE.COM. 5
ALT2.ASPMX.L.GOOGLE.COM. 5
ASPMX2.GOOGLEMAIL.COM. 10
ASPMX3.GOOGLEMAIL.COM. 10
ASPMX4.GOOGLEMAIL.COM. 10
ASPMX5.GOOGLEMAIL.COM. 10

There. Now all inbound email will check with your DNS server which tells it to go to Google, and they’ll direct it into the inbox associated with your domain. By the way, Google gives you up to 100 inboxes.

You can even send email from Gmail with your domain on it (@immicom.com instead of @Gmail.com) now. Looks pretty professional.

Biggest benefit: you know your sent mail will not get blocked by other ISPs.

 

 

 

Could you and your neighbors get T1 speed on DSL or Cable Modem?

March 15, 2007

Looking at the top security stories on Digg, I happened across ShandyKings blog post telling how he inadvertently used his neighbor’s Linksys router, simply because people don’t think about changing them from the default settings. In my own neighborhood, there are half a dozen wireless access points within range.

I also have had crappy Cable Modem service and have been looking into using DSL as a backup, combining both pipes with a multi-WAN router. Redundancy, load balancing,

Hmmm. Peanut butter. Jelly… whoa, I could make a sandwich!

Imagine a 6 WAN wireless router. You could effectively collude with your neighbors to get incredible bandwidth.

Actually, last time I was in Spain, a friend of mine recommended becoming a fonero so that I could leach off the wireless access points of other foneros in my neighborhood. Since I’m so dissatisfied with my cable modem, I’m always open to alternative bandwidth, such as Anne Zelenka mentioned on webworkerdaily: particularly FiOS. Too bad we’re on ATT. For now, I’ll stick with cable modem and DSL.

Dreamweaver replacement for Ubuntu Linux?

March 14, 2007

I’ve been trying Ubuntu (Xubuntu) Linux on a dual-boot system, and as I mentioned here, have been looking for a great replacement for Dreamweaver. Quanta Plus is one of the alternatives to consider, and I’ve got some first impressions, having used it for a few hours.

1) It’s not Dreamweaver. But it does support “projects” which remind me of the Sites used in Dreamweaver. It was a bit disorienting at first… was looking all over the GUI for an FTP or site setup dialog. Clicking on Projects brought up a window that seemed promising.

Project dialog

2) With the project set up, I noticed what should be a file tree in left side of the window, but it was empty, except for the root of the GMAT website. Where’s the files? There should be a GET button here somewhere. Hmmm. Here we go: right-click the root and select “Rescan Project” and you see this…

Add files to project dialog

This took quite a while, but then the site has a lot of files… and my cable ISP (Charter, ahem) has been very intermittent for the past 5 years. 10Meg down my arse. Oh well. After it scans, the dialog fills with a directory structure, and you can choose which files to add to your project.

3) Success! Files “added” appear in the left column.

Quanta Plus screenshot

First impressions? It’s usable and promising, but the code view renders a bit unpolished IMO. What’s interesting, and a bit scary, is that as I work on a file, it updates on the server via FTP. Normally, I would set up a local mirror of a site in Dreamweaver… and then send tested and approved files to the sky. Will dig around for a way to do this tomorrow.

Linux web development confessions of a Dreamweaver junkie

March 11, 2007

I’m hooked on Adobe. Dreamweaver does templates, code, WYSIWYG, active server pages, and more. Photoshop does everything else if there’s a pixel involved. But I’d like to be able to work on sites without booting into Windows.

After poking around on Google, it appears that Adobe really leads the pack when it comes to graphics and web development apps. Gimp is a decent replacement for some of the basic stuff you would do in Photoshop, but it’s limited by 8-bit per channel, where Photoshop allows 16. And the Linux apps in general seems to have forgotten about color correction. It’s not critical for web development, because ultimately, one doesn’t have control of the monitor quality of all the web visitors. So why bother, right?

As for a Dreamweaver replacement (or even a complement), it seems there are a few to consider. I ran across this post where NAyk discusses the positive and negative aspects of:

NVU – a bit like FrontPage. Actually, a lot like FrontPage in that both are being discontinued!

Komposer – an offshoot of NVU. I wasn’t even sure I found the official website. And it still says, “to be released in January 2007.” Doesn’t inspire confidence.

BlueFish – seems to be more for “coder” without a “designer” interface or templates. Uh, well then what does it have? Actually, I hardly use the designer view of Dreamweaver, but BlueFish lacks template support, so it gives me the impression it may be a glorified text editor. But I shall take a look and hope I’m surprised.

Quanta – from what I’ve seen, it’s supposed to be most like Dreamweaver. It may require installation of KDE-core on my lean and mean Xubuntu machine. Nuts. I’ll keep this in mind and give it a whirl and post about it.

Windows user converts to Ubuntu Linux

March 11, 2007

A few months back, I had an old (circa 2000) Dell Inspiron 8000 sitting around from an engineering project I did with them in a past life. It was running win2k but was still pretty sluggish by today’s standards. Was about to sell it on eBay for $20, but thought there might be a leaner OS… started looking into Linux.

Came across a review of the various Linux distros available and narrowed it down to Ubuntu — Xubuntu to be precise. Why? Xubuntu is built to run on older systems in 3rd world countries. Good. Downloaded and burned the “Live CD” so I could boot the laptop from the CD: try before you commit.

I was floored! In a couple of minutes it was up and running. And it joined my network via the wireless Orinoco card. Wow, that impressed me enough to wipe win2k out and install Xubuntu. It did require a bit of tweaking to get the proper display resolution.

Definitely worth it. In fact, I installed Xubuntu on my wife’s and mom’s new Lenovo laptops.