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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
07-18-2018, 03:22 AM
|
#1
|
Member
Registered: Feb 2016
Posts: 49
Rep: 
|
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
--
|
|
|
07-18-2018, 05:42 AM
|
#2
|
Senior Member
Registered: Oct 2005
Location: Horgau, Germany
Distribution: Manjaro KDE, Win 10
Posts: 2,199
Rep: 
|
You can safely remove these symlinks.
|
|
|
07-18-2018, 06:49 AM
|
#3
|
Senior Member
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,908
|
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.
|
|
|
07-18-2018, 07:24 AM
|
#4
|
Member
Registered: Aug 2008
Location: Yorkshire
Distribution: openSUSE(Leap and Tumbleweed) and a (not so) regularly changing third and fourth
Posts: 629
Rep: 
|
Quote:
Originally Posted by Dynosaw3
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.
|
|
|
07-18-2018, 07:28 AM
|
#5
|
LQ Veteran
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,866
|
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
|
|
|
07-18-2018, 08:19 AM
|
#6
|
Member
Registered: Feb 2016
Posts: 49
Original Poster
Rep: 
|
Thank you, everybody, for your quick responses.
Dynosaw
|
|
|
07-19-2018, 01:04 AM
|
#7
|
LQ Guru
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE & OS/2 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 6,592
|
Quote:
Originally Posted by petelq
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.
|
07-19-2018, 03:27 AM
|
#8
|
Member
Registered: Aug 2008
Location: Yorkshire
Distribution: openSUSE(Leap and Tumbleweed) and a (not so) regularly changing third and fourth
Posts: 629
Rep: 
|
Quote:
Originally Posted by mrmazda
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?
|
|
|
07-19-2018, 03:54 AM
|
#9
|
LQ Guru
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE & OS/2 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 6,592
|
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.
|
|
|
07-19-2018, 07:17 AM
|
#10
|
Member
Registered: Aug 2008
Location: Yorkshire
Distribution: openSUSE(Leap and Tumbleweed) and a (not so) regularly changing third and fourth
Posts: 629
Rep: 
|
Quote:
Originally Posted by mrmazda
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.
|
|
|
07-19-2018, 09:25 AM
|
#11
|
LQ Guru
Registered: Mar 2004
Distribution: Slackware
Posts: 6,858
|
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
|
|
|
07-19-2018, 04:32 PM
|
#12
|
Member
Registered: Aug 2008
Location: Yorkshire
Distribution: openSUSE(Leap and Tumbleweed) and a (not so) regularly changing third and fourth
Posts: 629
Rep: 
|
Quote:
Originally Posted by keefaz
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.
|
|
|
07-19-2018, 04:55 PM
|
#13
|
LQ Veteran
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,866
|
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
|
|
|
07-19-2018, 06:45 PM
|
#14
|
LQ Guru
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE & OS/2 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 6,592
|
Quote:
Originally Posted by petelq
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..
|
|
|
07-21-2018, 04:31 AM
|
#15
|
Member
Registered: Feb 2016
Posts: 49
Original Poster
Rep: 
|
Thanks everybody for a very interesting
and useful discussion.
I would like to close this thread out from
side.
Again thanks
Dynosaw
--
|
|
|
All times are GMT -5. The time now is 05:00 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|