0

When I run

$ ls /

I get back:

bin dev initrd.img lib64 mnt root snap sys var boot etc initrd.img.old lost+found opt run srv tmp vmlinuz cdrom home lib media proc sbin swapfile usr vmlinuz.old

I'm coming from using Windows a long time and usually I delete old image files. Is this normal in Linux, I'm trying to understand. Do I leave them be or can they/should the be removed?

4
  • You haven't provide OS/release details, but initrd means initial.ramdisk, the old one is used to boot an older kernel easily IF you have problems with upgrades/changes-to-your-latest kernel, so in theory it's not used, but it's there should you have problems. It's a link to the most-recent-but-old kernel (likewise to vmlinuz which is the kernel itself; v&z are old legacy posix/unix markers.. for virtual.mem & compressed) – guiverc Mar 25 '20 at 5:00
  • If you're never going to have a problem, or never going to reboot; yes they can be deleted. But if you can't guarantee either, I'd suggest leaving them (they are handy if problems occur to bypass the problem & get your system booted!) Clarification: Your system will boot fine if they are removed; but if you have problems with latest kernel & need the older one.. that's when used. If removed they'll likely re-appear on next kernel upgrade anyway – guiverc Mar 25 '20 at 5:02
  • Thanks for such a prompt detailed and helpful response! OS is Ubuntu 18.04. I will just leave them then. I'm sure they don't take much more than a couple hundred MB of ssd space anyway. I was just curious and after trying to remove the oldest kernel using `$ sudo apt-get purge \\old kernel verison pkg here\` the files were still showing up in directory tree – LinuxLinguist Mar 26 '20 at 3:11
  • If you stat /initrd.img.old you'll likely find it's a symbolic link (somewhat like shortcuts in windows; posix have multiple types of links) thus uses no disk space at all, it's just a entry in the file system that points to your prior kernel. – guiverc Mar 26 '20 at 4:17

0

Your Answer

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

Browse other questions tagged or ask your own question.