- What filesystem should /boot be?
- 3 Answers 3
- Linux File System Explained: Boot Loading, Disk Partitioning, BIOS, UEFI and File System Types
- Partition Table
- BIOS Vs UEFI
- Boot with BIOS
- Boot with UEFI
- Types of Linux File Systems
- ext2, ext3, ext4
- JFS
- ReiserFS
- XFS
- Btrfs
- Unix File Format
- Disk Partitioning
- Logical Volume Management
- Swap
- Encryption
What filesystem should /boot be?
I recently decided to set up my custom built system to be Linux only and I manually set up /boot, /, and swap partitions with /boot and / being ext4 filesystem types. Upon completing installation of Ubuntu 13.10 (as my 14.04 iso was corrupt) and restarting, I would be faced with grub rescue prompt. I tried installing the boot loader installation on /dev/sda and /dev/sda1 where my /boot partition was and it seemed my system could not find grub. I finally got tired of messing around with this and deleted all my partitions using GParted and installed from a Live DVD and allowed the installer to install Ubuntu for me. When it was done installing, I became curious and checked via GParted how the partitions were set up and the partitions were the same with the exception of /boot was using the fat32 filesystem. I rebooted the system and it booted up correctly with no problems. Are there certain filesystem types that should be used for the /boot partition simply so grub will be found/read?
3 Answers 3
In theory, almost anything that both the Linux kernel and GRUB (or whatever boot loader you use) can read is suitable for /boot . Most distributions default to ext4fs, but I’ve used ext2fs, ext3fs, and XFS with no problems under Ubuntu. I don’t recall offhand if JFS is supported at installation. If so it should work fine, too. ReiserFS, HFS+, and FAT are not supported for /boot by Ubuntu’s installer, but they all work fine if you set them up after the fact. Chances are a few more (NTFS, exFAT, and some others) would work, too, but I’ve never tried them — at least, not with GRUB. FAT deserves special mention because, if you’re using EFI, the EFI System Partition (ESP) is FAT, and mounting the ESP at /boot can simplify use of certain boot loaders and boot managers, such as ELILO and gummiboot, which require the kernel to reside on the same partition as the boot loader. Ubuntu uses GRUB 2 by default, so this isn’t an issue with Ubuntu if you use the default boot loader, but if you want to experiment it might be worth considering. OTOH, using FAT for /boot will slightly complicate OS version updates and re-installations.
One complication to changing the filesystem on /boot (on an already-installed system) is that you may need to completely re-install GRUB. The reason is that its filesystem driver gets built into its binary (stored in the sectors following the MBR, in the BIOS Boot Partition, or in the grubx64.efi file, depending on the boot mode and partition table type). Thus, if you change the filesystem, that binary must be reconstructed, which is done by grub-install . This isn’t an issue for fresh Ubuntu installations, since the installer will run grub-install as part of the installation process, so it should work fine as long as the Ubuntu installer itself accepts your choice of filesystem — which, as I’ve said, will actually narrow your choices from what GRUB permits.
Would my system being a UEFI system cause the problems I mentioned? I’m not as familiar with what UEFI is and how it would affect the installation of my system.
Yes. GRUB on EFI-based computers can be a bit flakier than GRUB on BIOS-based computers. Also, even though your computer uses EFI firmware, there’s no guarantee that Ubuntu installed in native EFI mode; it might have installed in BIOS/CSM/legacy mode. Worse, if you installed in one mode and then tried to repair in another, the inconsistency will make matters worse. Understanding your boot mode is critical, especially in dual-boot setups. See my Web page on the subject or the Ubuntu community wiki for details.
I think it’s probably a good idea to use ext4 or ext3, while XFS for example probably works fine today, older versions of the Fedora manual explicitly stated that only ext filesystems were supported. Since there’s not much difference, I think it makes sense to go with what is most likely to work, even on older systems.
Linux File System Explained: Boot Loading, Disk Partitioning, BIOS, UEFI and File System Types
The concept of boot loading, disk partitioning, partition table, BIOS, UEFI, File system types, etc. is little known to most of us. We comes across these terminology very often but rarely took the pain to know these and their meaning in details. This article in an effort to fulfil this gap in the most easiest way possible.
Partition Table
One of the very first decision we comes across while installing a Linux Distribution is the partitioning of its disk, the file-system to use, implement encryption for security which varies with the change in architecture and platform. One of the most widely used Architecture, INTEL is undergoing some changes and it is important to understand these changes which on the other hand requires knowledge of boot process.
Many developers run both Windows and Linux on the same machine which may be a matter of preference or need. Most of the boot-loaders of today are smart enough to recognize any number of Operating System on the same box and provide menu to boot into the preferred one. Another way to achieve the same goal is to use virtualization using Xen, QEMU, KVM or any other preferred visualization tool.
BIOS Vs UEFI
If I remember correctly, till late 90‘s BIOS which stands for Basic Input/Output System was the only way to boot an Intel System. BIOS holds the partitioning Information in an special area called Master Boot Record (MBR) such that additional code gets stored in first sector of every boot-able partition.
In Late 90‘s Microsoft’s intervention with Intel resulted in Universal Extensible Firmware Interface (UEFI) the initial purpose of which was to boot securely. This mechanism of booting proved to be a challenge for rootkits specially which gets attached with boot sectors and were hard to detect with BIOS.
Boot with BIOS
Booting with BIOS requires placing of boot codes or boot sequence in MBR which is placed in the first sector of boot disk. In case if more than one Operating System is installed the installed boot loader is replaced by one common boot loader which places boot codes on every bootable disk during installation and updation automatically, which means user has the choice to boot into any of the installed OS.
However it is seen, specially on windows that a non-windows boot loader won’t update the system specially certain programs viz., IE but again there is not hard and fast rule nor it is documented any where.
Boot with UEFI
UEFI is the latest booting technology developed in close collaboration of Microsoft with Intel. UEFI requires the firmware to be loaded is digitally signed, a way to stop rootkits being attached with the boot partition. However the problem in booting Linux using UEFI is complex. Booting Linux in UEFI requires the keys used needs to be make public under GPL which is against the Linux protocol.
However it is still possible to install Linux on UEFI specification by disabling ‘Secure boot‘ and enabling ‘Legacy Boot‘. Boot codes in UEFI is placed under subdirectories of /EFI, special partition in the first sector of disk.
Types of Linux File Systems
A standard Linux Distribution provides the choice of partitioning disk with the file formats listed below, each of which has special meaning associated with it.
ext2, ext3, ext4
These are the progressive version of Extended Filesystem (ext), which primarily was developed for MINIX. The second extended version (ext2) was an improved version. Ext3 added performance improvement. Ext4 was a performance improvement besides additional providing additional features.
JFS
The Journaled File System (JFS) was developed by IBM for AIX UNIX which was used as an alternative to system ext. JFS is an alternative to ext4 currently and is used where stability is required with the use of very few resources. When CPU power is limited JFS comes handy.
ReiserFS
It was introduced as an alternative to ext3 with improved performance and advanced features. There was a time when SuSE Linux‘s default file format was ReiserFS but later Reiser went out of business and SuSe had no option other than to return back to ext3. ReiserFS supports file System Extension dynamically which was relatively an advanced feature but the file system lacked certain area of performance.
XFS
XFS was a high speed JFS which aimed at parallel I/O processing. NASA still usages this file system on their 300+ terabyte storage server.
Btrfs
B-Tree File System (Btrfs) focus on fault tolerance, fun administration, repair System, large storage configuration and is still under development. Btrfs is not recommended for Production System.
Clustered File Format
Clustered file System is not required for booting but best suited in shared environment form storage point of view.
Non-Linux File Format
There are lots of File format not available under Linux but are used by other OS’s. Viz., NTFS by Microsoft, HFS by Apple/Mac os, etc. Most of these can be used under Linux by mounting them using certain tools like ntfs-3g to Mount NTFS file system but not preferred under Linux.
Unix File Format
There are certain File formats used widely in Linux but not preferred under Linux specially for installing Linux root System. e.g., UFS of BSD.
Ext4 is the preferred and most widely used Linux file System. In certain Special case XFS and ReiserFS are used. Btrfs is still used in experimental environment.
Disk Partitioning
The first stage is disk Partitioning. While partitioning we should keep the below points in mind.
- Partition keeping backup and recovery in mind.
- Space limitation mark in partition.
- Disk management – Administrative Function.
Logical Volume Management
LVM is a complex partitioning used in Large Storage Installation. The LVM structure overlays the actual physical disk partitioning.
Swap
Swap is used for memory paging in Linux specially during System Hibernation. The current stage of System is written to Swap when the system is paused (Hibernate) at a point of time.
A System which will never go hibernation needs a swap space equal to the size of its RAM.
Encryption
The last stage is encryption which ensures data safely. Encryption can be at the level of Disk as well as Directory. In Disk encryption, the whole disk is encrypted can requires some kind of special codes to decrypt it.
However its an complex issue. The decryption code can not remain on the same disk undergoing encryption hence we need certain special hardware or let the motherboard do it.
The disc encryption is relatively easy to achieve and is less complex. In this case the decryption code remains on the same disk, somewhere in different directory.
Disk encryption is necessary in server building and may be a legal issue based the the geographical location you are implementing it.
Here in this article, we tried throwing lights on File System Management as well as disk management in much more depth fashion. That’s all for now. I’ll be here again with Another Interesting article worth knowing. Till then Stay tuned and connected to Tecmint and don’t forget to provide us with your valuable feedback in the comment section below.