LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   How do i tell if 32 bit or 64 bit ubuntu is installed on a machine? (https://www.linuxquestions.org/questions/linux-software-2/how-do-i-tell-if-32-bit-or-64-bit-ubuntu-is-installed-on-a-machine-638622/)

lel4866 04-29-2008 06:11 AM

How do i tell if 32 bit or 64 bit ubuntu is installed on a machine?
 
I've tried all the uname options. uname -m says "x86_64", but that might just be describing the hardware, not the software. In /boot, in config-2.6.24-16, CONFIG_64BIT=Y, so maybe that means it's 64-bit?

David the H. 04-29-2008 07:21 AM

Try 'cat /proc/version' and see if the linux version info says amd64 or not.

Another option would be to fire up synaptic or something and see what version(s) of 'linux-image' (the kernel package) you have installed, assuming the kernel is a stock one and not manually compiled.

johnsfine 04-29-2008 08:11 AM

Quote:

Originally Posted by lel4866 (Post 3136493)
I've tried all the uname options. uname -m says "x86_64", but that might just be describing the hardware, not the software.

That is describing the software.

So you have a 64-bit kernel.

Quote:

In /boot, in config-2.6.24-16, CONFIG_64BIT=Y, so maybe that means it's 64-bit?
That also means it's 64-bit.

syg00 04-29-2008 09:20 AM

"file /sbin/init" will give you a pretty good indication.

lel4866 04-29-2008 03:14 PM

file /sbin/init gives:

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

cat /proc/version gives:

Linux version 2.6.24-16-generic (buildd@yellow) (gcc version 4.2.3 (Ubuntu 4.2.3-2ubuntu7)) #1 SMP Thu Apr 10 12:47:45 UTC 2008

So, given other comments, I will assume I have a 64-bit kernel. Which eliminates the need for a backup (right this instant), since I won't be reinstalling.

Thanks to all who chimed in.

Larry Lewis

spurnyn 02-22-2010 08:09 PM

What am I runnung?
 
Please help. I ran all three tests and it looks like they contradict each other. Am I running 32 or 64 bit kernel?

uname -r
2.6.26-2-amd64

CONFIG_64BIT=y
# CONFIG_X86_32 is not set
CONFIG_X86_64=y

file /sbin/init
/sbin/init: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.8, stripped

First two suggest I am running 64 bit.
Third one definitely point to 32 bit.

Thank you.

johnsfine 02-22-2010 09:39 PM

Quote:

Originally Posted by spurnyn (Post 3873300)
Please help. I ran all three tests and it looks like they contradict each other. Am I running 32 or 64 bit kernel?

uname -r
2.6.26-2-amd64

That is conclusive. 64 bit kernel.

Quote:

CONFIG_64BIT=y
# CONFIG_X86_32 is not set
CONFIG_X86_64=y
Assuming that is the config for the kernel you're actually running, that is also 64 bit.

Quote:

file /sbin/init
/sbin/init: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.8, stripped
So init is 32 bit. That is surprising for a Linux distribution with a 64 bit kernel. But it isn't impossible. 32 bit programs can run under a 64 bit kernel.

spurnyn 02-22-2010 11:13 PM

Thank you for fast response. I am obviously a newbie and have to do more reading. Does it mean that init is not part of the Kernel? Should I worry that it is 32 bit? Would it hunt me later?

Thank you.

koinobori 03-23-2010 10:29 AM

Quote:

Originally Posted by johnsfine (Post 3136592)
That is describing the software.

So you have a 64-bit kernel.



That also means it's 64-bit.

uname -m is really describing the SW?

from the manual page :

-m, --machine
print the machine hardware name

johnsfine 03-23-2010 11:33 AM

Quote:

Originally Posted by koinobori (Post 3909096)
uname -m is really describing the SW?

Yes, at least in cases such as X86 vs. X86_64 where different machine architectures could run on the same CPU.

uname -m will definitely say "X86_64" only when the kernel was compiled for X86_64 architecture. It will not give "X86_64" when an X86 kernel is running on X86_64 hardware.

Quote:

from the manual page :

-m, --machine
print the machine hardware name
I don't know whether that documentation is entirely misleading or whether it is just misleading for the question asked in this thread.

Running an old X86 kernel (2.4.21-47.0.1.ELsmp) on an X86_64 CPU, I find that uname -i displays "i386" while uname -m and uname -p each display "i686".

IIUC, that means the kernel was compiled to run on some X86 variant less than "i686" (not really a 386, because in Linux i386 doesn't really mean 386 anymore.) But the kernel can recognize that is running on a processor supporting the "i686" super-set of "i386".

So there can be both a hardware and software component to the information displayed by uname -m or uname -p.

koinobori 03-24-2010 04:17 PM

johnsfine thanks for the expanded explanation about that.

fredrikl 09-29-2011 07:10 AM

getconf LONG_BIT
That'll do the trick:)

jdkaye 09-29-2011 07:18 AM

@spurnyn
You're running a 2.6.26 which is a VERY old kernel. I'd be worried about that. What version of Debian are you running?
ciao,
jdk

Nylex 09-29-2011 07:55 AM

Another old thread, jdkaye.

jdkaye 09-29-2011 08:35 AM

:redface: aaaaaaaarrrrrrrrrrrrrrrgggggggggggggggggghhhhhhhhhhhhhh! I keep getting caught. :banghead:
Sorry about that. Old thread=old kernel.
jdk


All times are GMT -5. The time now is 04:04 AM.