LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 07-18-2018, 03:22 AM   #1
Dynosaw3
Member
 
Registered: Feb 2016
Posts: 48

Rep: Reputation: Disabled
Why the symlink to /boot/vmlinuz in root drectory??


In the root directory are a set of symlinks to the
kernel: /boot/vmlinuz-x.y.z and /boot/initrd.img-x.y.z.
1. What is the purpose of these symlinks?
2. Are they really necessary?
Other distros don't have them.

SYSTEM INFO:
Distro is Debian 9 "Stretch"; Boot loader is GRUB2;
BIOS is dual-personality set to "Legacy" (UEFI disabled).
Bootable root partition is sda1. (I suspect MBR,
but I'm not sure of this). There are other bootable hard disks
installed (sdb); holds old distro, not mounted on boot-up.

Thanks in advance.
Dynosaw
--
 
Old 07-18-2018, 05:42 AM   #2
Keruskerfuerst
Senior Member
 
Registered: Oct 2005
Location: Horgau, Germany
Distribution: Manjaro KDE, Win 10
Posts: 2,199

Rep: Reputation: 164Reputation: 164
You can safely remove these symlinks.
 
Old 07-18-2018, 06:49 AM   #3
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
The usual purpose is to provide a default boot - and the image used is then chosen via the redirected link.

But they aren't needed.
 
Old 07-18-2018, 07:24 AM   #4
petelq
Member
 
Registered: Aug 2008
Location: Yorkshire
Distribution: openSUSE(Leap and Tumbleweed) and a (not so) regularly changing third and fourth
Posts: 629

Rep: Reputation: Disabled
Quote:
Originally Posted by Dynosaw3 View Post
In the root directory are a set of symlinks to the
kernel: /boot/vmlinuz-x.y.z and /boot/initrd.img-x.y.z.
1. What is the purpose of these symlinks?
2. Are they really necessary?
Other distros don't have them.
Opensuse does this too. They're not really necessary of course but if you get stuck in a grub command line boot and can't remember the full kernel version you can get booted with just the symlinks. And they don't take up any disk space.
 
Old 07-18-2018, 07:28 AM   #5
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,426

Rep: Reputation: 1602Reputation: 1602Reputation: 1602Reputation: 1602Reputation: 1602Reputation: 1602Reputation: 1602Reputation: 1602Reputation: 1602Reputation: 1602Reputation: 1602
Quote:
They're not really necessary of course but if you get stuck in a grub command line boot and can't remember the full kernel version you can get booted with just the symlinks
I have done this very thing with multibooting
 
Old 07-18-2018, 08:19 AM   #6
Dynosaw3
Member
 
Registered: Feb 2016
Posts: 48

Original Poster
Rep: Reputation: Disabled
Thank you, everybody, for your quick responses.
Dynosaw
 
Old 07-19-2018, 01:04 AM   #7
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 5,920
Blog Entries: 1

Rep: Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082
Quote:
Originally Posted by petelq View Post
Opensuse does this too. They're not really necessary of course but if you get stuck in a grub command line boot and can't remember the full kernel version you can get booted with just the symlinks. And they don't take up any disk space.
In addition to simplifying working with a grub prompt, they're especially useful if multibooting. They're easily used in configuring a custom master bootloader menu that does not need to be updated every time a kernel is updated. I've been doing this for over a decade.
 
1 members found this post helpful.
Old 07-19-2018, 03:27 AM   #8
petelq
Member
 
Registered: Aug 2008
Location: Yorkshire
Distribution: openSUSE(Leap and Tumbleweed) and a (not so) regularly changing third and fourth
Posts: 629

Rep: Reputation: Disabled
Quote:
Originally Posted by mrmazda View Post
In addition to simplifying working with a grub prompt, they're especially useful if multibooting. They're easily used in configuring a custom master bootloader menu that does not need to be updated every time a kernel is updated. I've been doing this for over a decade.
I like the sound of this but you would have to update each symlink every time. Does this work out quicker?
 
Old 07-19-2018, 03:54 AM   #9
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 5,920
Blog Entries: 1

Rep: Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082
A master bootloader is not touched by any of the installed systems, so its menu is static until changed by the admin. Thus each vmlinuz and initrd in its menu stanzas don't need to be changed when a new kernel is installed. Only the OS with a new kernel needs changing, which some, like openSUSE, do automatically.

The concept can be applied rather simply on UEFI systems via a custom.cfg managed by the admin, and a modification of /etc/grub.d/ changing (mv) 41-custom to 07-custom, which moves the admin's custom menu to live at the top of the boot menu.
 
Old 07-19-2018, 07:17 AM   #10
petelq
Member
 
Registered: Aug 2008
Location: Yorkshire
Distribution: openSUSE(Leap and Tumbleweed) and a (not so) regularly changing third and fourth
Posts: 629

Rep: Reputation: Disabled
Quote:
Originally Posted by mrmazda View Post
A master bootloader is not touched by any of the installed systems, so its menu is static until changed by the admin. Thus each vmlinuz and initrd in its menu stanzas don't need to be changed when a new kernel is installed. Only the OS with a new kernel needs changing, which some, like openSUSE, do automatically.

The concept can be applied rather simply on UEFI systems via a custom.cfg managed by the admin, and a modification of /etc/grub.d/ changing (mv) 41-custom to 07-custom, which moves the admin's custom menu to live at the top of the boot menu.
I see now. I use a separate /boot with all entries from 3 partitions so that wouldn't work for me. I'll just have to continue editing grub.cfg. I use 90_persistent on my main system (opensuse 15) and remove x from all other grub.d entries. I'm not sure that the 90_persistent grub entry is available on many other distros.
 
Old 07-19-2018, 09:25 AM   #11
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
You can add more symlinks, eg vmlinuz-slackware, vmlinuz-suse...
I think the point is no need to update bootloader config after a kernel update, just update symlink
 
Old 07-19-2018, 04:32 PM   #12
petelq
Member
 
Registered: Aug 2008
Location: Yorkshire
Distribution: openSUSE(Leap and Tumbleweed) and a (not so) regularly changing third and fourth
Posts: 629

Rep: Reputation: Disabled
Quote:
Originally Posted by keefaz View Post
You can add more symlinks, eg vmlinuz-slackware, vmlinuz-suse...
I think the point is no need to update bootloader config after a kernel update, just update symlink
That's why I was interested but I think it's just as quick to do grub.cfg edit once I started to think it through.
 
Old 07-19-2018, 04:55 PM   #13
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,426

Rep: Reputation: 1602Reputation: 1602Reputation: 1602Reputation: 1602Reputation: 1602Reputation: 1602Reputation: 1602Reputation: 1602Reputation: 1602Reputation: 1602Reputation: 1602
Except for a few, most distros auto run update-grub or something similar during updates for new kernels, So I create a custom menu for each partition using the grub configfile= to boot other distros with there own grub.cfg in a custom file before the osprober file in /etc/grub.d
 
Old 07-19-2018, 06:45 PM   #14
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 5,920
Blog Entries: 1

Rep: Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082Reputation: 2082
Quote:
Originally Posted by petelq View Post
I use a separate /boot with all entries from 3 partitions so that wouldn't work for me. I'll just have to continue editing grub.cfg. I use 90_persistent on my main system (opensuse 15) and remove x from all other grub.d entries.
I too use a "separate boot". However, it is never mounted to /boot. It's used only for booting, not for providing a home for kernels and initrds, which continue to live on their respective / partitions in their /boot directories. The symlinks live in those locations, while the boot control primary partition houses the mostly static boot menu that either loads kernels and initrds via symlinks, chainloads to the bootloaders on the respective filesystems, or uses the configfiles on the various installations. The only useful symlink renaming would be facilitating previous kernel versions in the master bootloader menu. My convention where desired is cp'ing or mv'ing existing symlinks immediately prior to kernel installation: vmlinuz-prv>vmlinuz-prv2; vmlinuz>vmlinuz-prv; initrd-prv>initrd-prv2; initrd>initrd-prv; etc..
 
Old 07-21-2018, 04:31 AM   #15
Dynosaw3
Member
 
Registered: Feb 2016
Posts: 48

Original Poster
Rep: Reputation: Disabled
Thanks everybody for a very interesting
and useful discussion.
I would like to close this thread out from
side.
Again thanks
Dynosaw
--
 
  


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
[SOLVED] 1st boot attempt: error: file '/boot/vmlinuz-4.13.9' not found hariskar Linux From Scratch 24 10-30-2017 09:11 AM
for vmlinuz + initrd, append CML how to set root=??? kevin616 Linux - Newbie 0 10-21-2014 08:46 PM
why can't I make this symlink except as root? newbiesforever Linux - General 4 03-13-2010 03:16 PM
[SOLVED] How to user vmlinuz-generic instead of vmlinuz-huge-smp? cola Slackware 12 09-15-2009 01:54 PM
Want to install Mail Server on CentOS 5.0 which support both Ldap and Active Drectory ad1325 Linux - Server 2 03-19-2009 12:27 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:55 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
Open Source Consulting | Domain Registration