Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Boot Loader Information
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
malern
Apprentice
Apprentice


Joined: 19 Oct 2006
Posts: 170

PostPosted: Wed Apr 07, 2010 4:00 pm    Post subject: Boot Loader Information Reply with quote

Is there an easy way to dump the boot loader information for a specific device? I'd like a program that can take a device name (e.g. /dev/sda) and tell me if there is a boot loader installed on it, what boot loader it is (e.g. grub, lilo, or something else), and any other interesting information. Similar to how "file /path/to/file" will give you some basic information about a file.

Anybody know of anything like that?
Back to top
View user's profile Send private message
audiodef
Watchman
Watchman


Joined: 06 Jul 2005
Posts: 6639
Location: The soundosphere

PostPosted: Wed Apr 07, 2010 4:20 pm    Post subject: Reply with quote

I don't know of a program, but for starters you can look at the drive in fdisk to determine the file system, mount the drive, and look at the files in /. That might tell you everything you need to know. If it's a Linux system, there's likely a /boot partition. If not, fdisk might tell you which partition was made bootable and you can look at that partition when you mount it.
_________________
decibel Linux: https://decibellinux.org
Github: https://github.com/Gentoo-Music-and-Audio-Technology
Facebook: https://www.facebook.com/decibellinux
Discord: https://discord.gg/73XV24dNPN
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54317
Location: 56N 3W

PostPosted: Wed Apr 07, 2010 5:13 pm    Post subject: Reply with quote

malern,

You can do
Code:
hexedit /dev/...

Look at the code between address 0x0 and 0x1ff. If you have a DOS or Grub bootloader, it will be obvious.
I've never seen lilo or ntldr to know what they look like.

hexedit can write bytes anywhere on your drive - take great care not to write anything.
There is no undo.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
d2_racing
Bodhisattva
Bodhisattva


Joined: 25 Apr 2005
Posts: 13047
Location: Ste-Foy,Canada

PostPosted: Thu Apr 08, 2010 1:33 am    Post subject: Reply with quote

When I was a student, I used Winhex to learn these things :P
Back to top
View user's profile Send private message
malern
Apprentice
Apprentice


Joined: 19 Oct 2006
Posts: 170

PostPosted: Thu Apr 08, 2010 9:30 am    Post subject: Reply with quote

Thanks for the tips guys!

I've also just discovered you can actually use "file" with the -s switch to get the info (i.e. file -s /dev/sda)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum