LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-28-2015, 02:00 AM   #1
aavika
Member
 
Registered: Dec 2014
Posts: 82

Rep: Reputation: Disabled
read HDD no. and mac address


hello all,
I am using linux machine. There are total 6 stages of linux boot process: BIOS
MBR
GRUB
KERNEL
INIT
RUNLEVEL
Is it possible to read HDD serial number and mac address from the GRUB??

Thanks in advance..
 
Old 03-28-2015, 03:15 AM   #2
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 476Reputation: 476Reputation: 476Reputation: 476Reputation: 476
Never thought of checking it during boot up. Have a look at /var/log/dmesg if it shows up there then yes else no. You use:

Code:
less /var/log/dmesg
or

Code:
dmesg | less
 
Old 03-28-2015, 03:26 AM   #3
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 476Reputation: 476Reputation: 476Reputation: 476Reputation: 476
I just had a look at my system's dmesg and I don't see that. Possible to show up but it depends on driver in-use as well. I mean if driver is written or specifically instructed to disclose then it will show up else it will not.
 
Old 03-28-2015, 03:46 AM   #4
aavika
Member
 
Registered: Dec 2014
Posts: 82

Original Poster
Rep: Reputation: Disabled
Thank you for the reply..
i wrote that command and its not giving mac address or hdd no.
so its not possible to read both during boot up?????
Any other command..?
 
Old 03-28-2015, 03:53 AM   #5
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 476Reputation: 476Reputation: 476Reputation: 476Reputation: 476
Which command you wrote and where?
 
Old 03-28-2015, 03:56 AM   #6
aavika
Member
 
Registered: Dec 2014
Posts: 82

Original Poster
Rep: Reputation: Disabled
which driver??
do u have any idea about this: net_pxe_mac

i found in grub https://www.gnu.org/software/grub/ma...e/Network.html
 
Old 03-28-2015, 04:05 AM   #7
aavika
Member
 
Registered: Dec 2014
Posts: 82

Original Poster
Rep: Reputation: Disabled
sorry T3RM1NVT0R,
i dont know anything about this...
wrote 'less /var/log/dmesg' in linux terminal
 
Old 03-28-2015, 04:45 AM   #8
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 476Reputation: 476Reputation: 476Reputation: 476Reputation: 476
The link that you shared is about performing network installation and they have explained various options available with grub. So, I have no idea on why you are looking for mac address or hdd serial number as it can be done without those as well.

You said you want to know hdd serial number and mac address during boot up. Still am not sure why it is required.

If you want to know the serial number of your hdd you can run:

Code:
hdparm -I /dev/sdX
where X is the alphabet assigned on the basis of the slot you attached your hdd to.

For getting the MAC address you can simply use:

Code:
ifconfig -a
or

Code:
ifconfig ethX
where X is number assigned to your network card.

You said you want to see it during bootup. Not sure if it will be possible, what I can think of is putting these commands in /etc/rc.d/rc.sysinit which is a script that runs by init during boot process. Make sure that you do not mess up with this script. Edit carefully and make sure you back it up before editing.
 
Old 03-28-2015, 06:10 AM   #9
aavika
Member
 
Registered: Dec 2014
Posts: 82

Original Poster
Rep: Reputation: Disabled
okay i got it..
checked those commands in terminal and it gives the result what i want.
Now i have to put commands in rc.sysinit file.
where should i add these commands in the file, is it ok if i add them at the start??
I have already taken backup of the file , so that if something goes wrong with the original file then i will replace with the backup.

Thank you...
 
Old 03-28-2015, 06:23 AM   #10
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 476Reputation: 476Reputation: 476Reputation: 476Reputation: 476
No don't put it at the beginning put it at the end of the file. As I said I haven't tried this before but you can put those commands in sysinit file and hope it shows up the stuff in dmesg or boot.log
 
Old 03-28-2015, 06:28 AM   #11
aavika
Member
 
Registered: Dec 2014
Posts: 82

Original Poster
Rep: Reputation: Disabled
okay i will add at the end of the file and will see if it works..
Thank you so much...
 
Old 03-28-2015, 06:29 AM   #12
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 476Reputation: 476Reputation: 476Reputation: 476Reputation: 476
You're welcome.

Please mark the thread as solved if you think that your query has been answered.

Enjoy Linux!!!
 
Old 03-28-2015, 07:09 AM   #13
aavika
Member
 
Registered: Dec 2014
Posts: 82

Original Poster
Rep: Reputation: Disabled
okay...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Read Mac Address In vif-bridge (Xen) blackmetal Linux - Networking 0 08-30-2011 07:00 AM
how do I find what MAC address web pages see as my MAC address rob.rice General 20 05-29-2010 03:08 AM
Ethernet MAC Addresses database; MAC address-based processing cctualatin Linux - Newbie 1 04-14-2009 09:59 AM
how to get ip address, broadcast address, mac address of a machine sumeshstar Programming 2 03-12-2005 05:33 AM


All times are GMT -5. The time now is 10:38 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration