Linux determines whether the CPU is 32-bit or 64-bit, and whether the system is 32-bit or 64-bit

Source: Internet
Author: User

from:http://www.ipcpu.com/2010/08/linux-cpu-32-64/

This article is limited to server CPU and Linux system discussions, regardless of desktop PC or notebook.

32-bit, 64-bit can not be installed, 64 can be installed 32-bit, because 64-bit CPU can be compatible with 32-bit, 32-bit will not be 64-bit.
Recently deployed MongoDB, the system is 32-bit prompt will have the maximum file 2G limit. There are also the most common problems with 32-bit systems that do not support more than 4G of memory, even if the PAE efficiency is affected.

1. Determine whether the CPU is 32-bit or 64-bit

This question is more interesting, the method given online is to determine the number of bits of the system, does not represent the number of CPU bits. Detailed can look at this post: http://bbs2.chinaunix.net/viewthread.php?tid=1600422 "more classic technical posts and controversy posts"

Method:
[Email protected] ~]# cat/proc/cpuinfo | grep lm
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 t M syscall
NX LM CONSTANT_TSC pni monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr sse4_1 lahf_lm

LM indicates long mode–64 bit CPU

2. Judge whether the system is 32-bit or 64-bit

[Email protected] ~]# uname-a
Linux s1.ipcpu.com 2.6.18-164.el5pae #1 SMP Thu Sep 3 04:10:44 EDT i686 i686 i386 gnu/linux

i686 i386 are 32-bit operating systems

[Email protected] ~]# uname-a
Linux s2.ipcpu.com 2.6.18-164.6.1.el5 #1 SMP Tue Nov 3 16:12:36 EST x86_64 x86_64 x86_64 gnu/linux

X86_64 bit 64-bit operating system, in some places also called AMD64, but not AMD's CPU, but 64-bit AMD first launched.

In addition getconf Long_bit can also judge the current system word length.

If your cpuinfo output has an LM flag, and the output of the UNAME-A command is i386 or i686, you are a 64-bit CPU running 32-bit system

Reference:
http://blog.csdn.net/eiyaa/archive/2009/05/14/4184353.aspx
/http bbs2.chinaunix.net/viewthread.php?tid=1600422
Http://www.linuxquestions.org/questions/linux-general-1/ proc-cpuinfo-flag-lm-358563/
http://www.unixtutorial.org/2009/05/ how-to-confirm-if-your-cpu-is-32bit-or-64bit/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.