1

Long time ago I have installed a few Linux distros on various drives / partitions.

Now I need to know what a distro is on a specified drive / partition, without to have to boot it.

I have mounted and I can use, e.g., the directory /boot.

Earlier, a distro KNOPPIX had in this directory (or perhaps in dir with other name) a file showing the knoppix-version. Other distros don't have such a file.

From

/media/sda3/boot/grub/grub.cfg

I can read what grub would offer to boot. But this is not what I want.

vmlinux... has information about the kernel

/media/sda3/boot/vmlinuz-5.4.0-42-generic

but this is a binary.

I there a tool to extract more information than the filename says?

But this is not the name, version, release of the distribution.

How can I get that without to boot?

1
  • Many, but not all, will have /etc/os-release files, those can be a start. Do you need the distribution name or the kernel info?
    – terdon
    May 27 at 10:52

1 Answer 1

1

Multiple ways:

  1. Run file /path/to/vmlinuz-something which will tell you the exact kernel version which you can then google to find out what the distro you're using, e.g.
$ file /boot/vmlinuz-5.16.15-201.fc35.x86_64 
/boot/vmlinuz-5.16.15-201.fc35.x86_64: Linux kernel x86 boot executable bzImage, version 5.16.15-201.fc35.x86_64 (mockbuild@bkernel01.iad2.fedoraproject.org) #1 SMP PREEMPT Thu Mar 17 05:45:13 UTC 2022, RO-rootFS, swap_dev 0XA, Normal VGA
  1. strings /bin/any_binary | grep gcc which show you a GCC release which is normally unique for a specific distro.

  2. cat /etc/os-release but this doesn't always work and isn't always present.

  3. Multiple files in /var/log could contain info about your distro.

1
  • thanks, I will try. Regards anttondhidh May 29 at 12:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.