LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   how to check linux kernel is 32 bit or 64 bit (http://www.linuxquestions.org/questions/linux-general-1/how-to-check-linux-kernel-is-32-bit-or-64-bit-612352/)

surprise_frnd 01-09-2008 10:12 AM

how to check linux kernel is 32 bit or 64 bit
 
hi all,

can u tell me how can i find the linux installation is 32bit or 64 bit ...?


i have ran the getconf WORD_BIT and getconf WORD_LENGTH .. i am confused.

HappyTux 01-09-2008 10:30 AM

Usually it is in the name of the kernel.

Code:

>$ uname -m
x86_64

Tells me I am running a 64bit kernel or check a binary file on the system if it is 64bit good chance you are running 64bit.

Code:

>$ file /usr/bin/file
/usr/bin/file: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), for GNU/Linux 2.6.8, dynamically linked (uses shared libs), stripped


surprise_frnd 01-09-2008 10:47 AM

Quote:

Originally Posted by HappyTux (Post 3016767)
Usually it is in the name of the kernel.

Code:

>$ uname -m
x86_64

Tells me I am running a 64bit kernel or check a binary file on the system if it is 64bit good chance you are running 64bit.

Code:

>$ file /usr/bin/file
/usr/bin/file: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), for GNU/Linux 2.6.8, dynamically linked (uses shared libs), stripped




Thanks for the quick response ..

If i run file on any x86_64 system's library under /lib is showing 32 bit LSB executable ..



if its x86_64; the library also should be 64bit executable right ...?

pls advice

Harry Seldon 01-10-2008 03:39 PM

I don't think it has to. I run 32bit apps on 64bit kernels. I think you just don't get the performance benefits of running true 64bit code on the kernel.

syg00 01-10-2008 05:01 PM

cat /proc/cpuinfo - look for "lm" in the flags

Edit: mmmm; didn't read the question. That'll tell you hardware capability. For the kernel, it's in the config, but recently changed.

Uncle_Theodore 01-10-2008 05:19 PM

One certainly can run 32-bit apps on a 64-bit system, if the system is multilib. But you can look at parts of the system itself to verify that it's 64-bit. Like this, for example
Code:

file /sbin/init
/sbin/init: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), for GNU/Linux 2.6.16, dynamically linked (uses shared libs), stripped


knockout_artist 01-30-2008 11:26 AM

Quote:

uname -m
i686
Quote:

#uname -ar
Linux linux 2.6.22.5-31-default #1 SMP 2007/09/21 22:29:00 UTC i686 i686 i386 GNU/Linux
What am I running here? is that 64 bit OS??
Because some of applications acting like it is 64 bit?
Do I need to go back in i386?
my cpu info
Quote:

cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 15
model name : Intel(R) Core(TM)2 Duo CPU T7300 @ 2.00GHz
stepping : 10
cpu MHz : 800.000
cache size : 4096 KB
physical id : 0
siblings : 2
core id : 0
cpu cores : 2
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
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 pbe nx lm constant_tsc pni monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr lahf_lm
bogomips : 3995.43
clflush size : 64

processor : 1
vendor_id : GenuineIntel
cpu family : 6
model : 15
model name : Intel(R) Core(TM)2 Duo CPU T7300 @ 2.00GHz
stepping : 10
cpu MHz : 800.000
cache size : 4096 KB
physical id : 0
siblings : 2
core id : 1
cpu cores : 2
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
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 pbe nx lm constant_tsc pni monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr lahf_lm
bogomips : 3990.01
clflush size : 64


markhud 07-26-2011 09:30 PM

Quote:

Originally Posted by knockout_artist (Post 3040099)
What am I running here? is that 64 bit OS??
Because some of applications acting like it is 64 bit?
Do I need to go back in i386?
my cpu info

If it was 64-bit, there would be a 64 in it. i386 is old-school 32-bit for the 386, 486, and early Pentiums and AMD. The i686 tag is modern 32-bit OS that includes extensions and performance-enhancements for most Pentium-class CPUs and AMD processors.

pavasatya 11-10-2011 04:30 AM

To know whether our Linux kernel is 32 bit or 64 bit
 
To know whether our Linux kernel is 32 bit or 64 bit

Use this command getconf LONG_BIT

cascade9 11-10-2011 05:22 AM

Quote:

Originally Posted by knockout_artist (Post 3040099)
What am I running here? is that 64 bit OS??
Because some of applications acting like it is 64 bit?
Do I need to go back in i386?

i686, that is 32bit. No need to 'go back' to i386, your CPU has no problems with i686. If its even possible to get an i386 kernel for your distro.....

BTW, "linux 2.6.22.5-31-default", is that openSUSE 10.3? If it is, you should really get a newer version, or a different distro- openSUSE 10.3 has been out of support' for years now (end of life for 10.3 was 31st of October, 2009).

Quote:

Originally Posted by markhud (Post 4426205)
The i686 tag is modern 32-bit OS that includes extensions and performance-enhancements for most Pentium-class CPUs and AMD processors.

Just FYI, the original 'pentium' class intel CPUs are only i586, not i686. The 1st i686 (P6) intel CPU was the Pentium Pro/Pentium II, the 1st AMD i686 CPU was the athlon, and I honestly forget what the 1st i686 VIA/cyrix CPU was.

Dinjy 12-24-2011 06:19 AM

If you want to check you system kernel than if you will use manually code to check it. it may be that code can be wrong or process can be wrong. but if you will use Linux Boot Disk to check your kernel. than you will get right answer.

onebuck 12-24-2011 06:52 AM

Member response
 
Hi,

Most Gnu/Linux install CD/DVD provide a means to boot the system. You can then use the booted system to diagnose or work on the system in question. One can look at '/proc/cpuinfo' since the booted kernel provides this information. You can also use ' dmidecode' to identify system information.

fmds 04-21-2012 12:14 AM

Command
 
Quote:

Originally Posted by pavasatya (Post 4520438)
To know whether our Linux kernel is 32 bit or 64 bit

Use this command getconf LONG_BIT

Thank you!

dadoprso 10-16-2012 09:55 AM

Quote:

Originally Posted by HappyTux (Post 3016767)
Usually it is in the name of the kernel.

Code:

>$ uname -m
x86_64

Tells me I am running a 64bit kernel or check a binary file on the system if it is 64bit good chance you are running 64bit.

Code:

>$ file /usr/bin/file
/usr/bin/file: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), for GNU/Linux 2.6.8, dynamically linked (uses shared libs), stripped


Sweet thanks!


All times are GMT -5. The time now is 07:48 PM.