For my x86 machines at work, I’m all Linux. Frankly, I just don’t understand Windows Server. Yes, my laptop runs Windows because I have business apps that need Windows. But all the real work gets done by Linux or its Unix friends or mainframes. (I’m sure there are people who will disagree, but I digress). So when I got some surplus hardware that was a bit old, I wanted to put a 64-bit Linux OS on it, but wasn’t sure if the CPU was 64-bit capable. So how to tell? Some search results focused mostly on running Windows and looking at the Computer properties, but I’m not running Windows. Thankfully, there is an easy way. (Some people complain Unix is user-hostile. I think it is expert-friendly. But I digress again).
Get yourself a Live CD of your favorite distro. My current favorite is Fedora. A Live CD is a bootable CD that will let you run the OS without installing it on your hard drive. Yeah, when you shut down all the data is gone, and the Live CD does run slow, but it is a great tool for doing tasks like the following. Most Live CDs are 32-bit, but that is OK – you need the OS just to probe the hardware.
Get to a shell prompt and run the command “cat /proc/cpuinfo”. The proc filesystem is something I have come to love as I’ve learned more about Linux, but I digress yet again. The output of that command should look something like this:
[marcelk@alma ~]$ cat /proc/cpuinfo processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 15 model name : Intel(R) Core(TM)2 Duo CPU E6750 @ 2.66GHz stepping : 11 cpu MHz : 2000.000 cache size : 4096 KB physical id : 0 siblings : 2 core id : 0 cpu cores : 2 fpu : yes fpu_exception : yes cpuid level : 10 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx lm constant_tsc pni monitor ds_cpl vmx smx est tm2 cx16 xtpr lahf_lm bogomips : 5323.55 clflush size : 64 cache_alignment : 64 address sizes : 36 bits physical, 48 bits virtual power management:
So out of all those lines, take a look at the one that says “flags:”. There are a bunch of codes there, the meaning for those codes is described in the file /usr/include/asm/cpufeature.h. The flag you want to see is “lm”. It’s an abbreviation for “long mode”, which basically means your CPU is x86_64 capable. So you can run 64-bit Linux, 64-bit Windows, or 64-bit whatever, even though you currently aren’t running it at the moment. If the “lm” flag doesn’t appear, then you have only a 32-bit CPU that can run only a 32-bit OS.
So yes, I can run 64-bit Linux on the computer above. And so… squirrel! … but I digress again.
amir responded on 26 Apr 2010 at 12:13 pm #
great stuff. I learn new thing today. cat /proc/cpuinfo .
Anyway, recently I did a silly test on my own to see if my laptop is 64 bit. I downloaded the Ubuntu 64 bit live image. I use UNetBootin to put it in a USB drive (1G). Then I just boot from the USB. On a 64 bit pc, it will boot and goes into the desktop. For 32 bit, it will give you an error.
Not the most elegant way, but it give me a quick indication of which PC is 64 bit.
marcelk responded on 14 Jan 2011 at 1:49 pm #
Oh, and since recent computers can boot from a USB stick, you can put the operating system onto your existing USB stick instead of burning a CD. Fedora even has a wonderful tool for doing it from Windows: LiveUSB Creator. Just click a couple buttons and it automatically sets up your USB stick to boot live images. Very cool and incredibly easy to use.