Abstract
Basic Input Output System
, which is described in Section 2, “Bootloader Basics”. Newer systems, such as those sold with Windows 8, use a newer type called UEFI or Universal Extensible Firmware Interface
, which is described in Section 2, “Bootloader Basics”
Using Root
Safely
root
. The root
account should be used with educated caution and only when required. Your system can break or fail to boot if the account is misused.
sudo
to enter your user password and execute privileged commands:
[fedorauser@localhost ~]$ sudo <command>
[sudo] password for fedorauser:
su
. The hyphen ( - ) in the example is important because it ensures that you will work in a root environment, and not act on normal user files with root privileges.
[fedorauser@localhost ~]$ su -
Password:
[root@localhost ~]#
root prompt
is always a hash ( # ) and a normal user prompt is always a dollar sign ( $ ). Example commands in this guide will include one of these prompts to show the privileges required for the action.
/boot/efi
. Each operating system places files required for booting in a dedicated directory of this partition, and the boot entry in the firmware points to these files. UEFI systems will usually also support BIOS style booting for compatibility reasons, using a feature called the Compatibility Support Module (CSM).
boot partition
, mounted at and known as /boot
. The boot partition contains the kernel, a read only filesystem that holds tools used by the kernel during bootup, called an initramfs
, and files for the menus and for the bootloader itself. These files were traditionally placed on a different partition because the bootloader did not support complex storage arrangements, and could not read the kernel and initramfs from them. Because a simple, separate boot also allows for easier disaster recovery, the practice has continued to this day.
GNU GRand Unified Bootloader
. GRUB provides a boot menu and support for many filesystems, as well as software for scanning the system for available operating systems and adding them to the menu.
Identifying a BIOS system
The term BIOS
is still used with UEFI systems
BIOS
is often used to describe UEFI systems as well. Manufacturers might list system firmware updates as BIOS updates
or provide directions to enter the BIOS setup menu
. The word has come to represent the pre-OS menu on your computer as much as the actual software, but your system may still be UEFI capable.
Identifying a UEFI system
UEFI: Generic USB Stick Generic USB Stick UEFI: DVD-RW Drive DVD-RW Drive Fedora Windows
Disable Windows fast reboot
feature!
Procedure 1. Selecting and resizing a partition.
#
blkid
/dev/sda1: SEC_TYPE="msdos" UUID="32AE-E651" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="0315942d-8c2c-414f-a560-cfa499494a72" /dev/sda2: UUID="593153ae-2b67-4a5b-9efa-fa3954953abd" TYPE="ext4" PARTUUID="68cadad8-6de2-4ef7-96ff-f58e5114fdcc" /dev/sda3: UUID="P2xKTQ-aQWG-z2Uv-jSw5-kkUK-SN5Q-cNf3PI" TYPE="LVM2_member" PARTUUID="7ba7ed40-b43f-4e71-b83e-51629bf7db47" /dev/sda5: UUID="44B6BAD1B6BAC2AA" TYPE="ntfs" PARTUUID="9c62d1dc-dedd-4d4c-9728-5f2ef69f2b42"
ntfs
partitions indicate the existing Windows installation. Examine the partitions on the /dev/sda
drive.
#
parted /dev/sda print
Model: ATA ST9320328CS (scsi) Disk /dev/sda: 320GB Sector size (logical/physical): 512B/512B Partition Table: gpt Disk Flags: pmbr_boot Number Start End Size File system Name Flags 1 1049kB 211MB 210MB fat16 EFI System Partition boot 2 211MB 735MB 524MB ext4 3 735MB 119GB 118GB 4 119GB 119GB 134MB Microsoft reserved partition msftres 5 119GB 215GB 96.2GB ntfs
#
ntfsresize --info /dev/sda5
ntfsresize v2013.1.13 (libntfs-3g) Device name : /dev/sda5 NTFS volume version: 3.1 Cluster size : 4096 bytes Current volume size: 96234107392 bytes (96235 MB) Current device size: 96234110976 bytes (96235 MB) Checking filesystem consistency ... 100.00 percent completed Accounting clusters ... Space in use : 29222 MB (30.4%) Collecting resizing constraints ... You might resize at 29221265408 bytes or 29222 MB (freeing 67013 MB). Please make a test run using both the -n and -s options before real resizing!
#
ntfsresize --size 40G /dev/sda5
ntfsresize v2013.1.13 (libntfs-3g) Device name : /dev/sda5 NTFS volume version: 3.1 Cluster size : 4096 bytes Current volume size: 96234107392 bytes (96235 MB) Current device size: 96234110976 bytes (96235 MB) New volume size : 39999996416 bytes (40000 MB) Checking filesystem consistency ... 100.00 percent completed Accounting clusters ... Space in use : 29222 MB (30.4%) Collecting resizing constraints ... Needed relocations : 0 (0 MB) WARNING: Every sanity check passed and only the dangerous operations left. Make sure that important data has been backed up! Power outage or computer crash may result major data loss! Are you sure you want to proceed (y/[n])? y Schedule chkdsk for NTFS consistency check at Windows boot time ... Resetting $LogFile ... (this might take a while) Updating $BadClust file ... Updating $Bitmap file ... Updating Boot record ... Syncing device ... Successfully resized NTFS on device '/dev/sda5'. You can go on to shrink the device for example with Linux fdisk. IMPORTANT: When recreating the partition, make sure that you 1) create it at the same disk sector (use sector as the unit!) 2) create it with the same partition type (usually 7, HPFS/NTFS) 3) do not make it smaller than the new NTFS filesystem size 4) set the bootable flag for the partition if it existed before Otherwise you won't be able to access NTFS or can't boot from the disk! If you make a mistake and don't have a partition table backup then you can recover the partition table by TestDisk or Parted's rescue mode.
Procedure 2. Resizing the partition
#
parted /dev/sda unit s print
Model: ATA ST9320328CS (scsi) Disk /dev/sda: 625142448s Sector size (logical/physical): 512B/512B Partition Table: gpt Disk Flags: pmbr_boot Number Start End Size File system Name Flags 1 2048s 411647s 409600s fat16 EFI System Partition boot 2 411648s 1435647s 1024000s ext4 3 1435648s 232122367s 230686720s 4 232122368s 232384511s 262144s Microsoft reserved partition msftres 5 232384512s 420341759s 187957248s ntfs 6 420341760s 420343807s 2048s bios_grub 7 420343808s 421367807s 1024000s ext4 8 421367808s 625141759s 203773952s
232384512
, and the sector size is 512 bytles
#
ntfsfix -d /dev/sda5
Mounting volume... OK Processing of $MFT and $MFTMirr completed successfully. Checking the alternate boot sector... OK NTFS volume version is 3.1. NTFS partition /dev/sda5 was processed successfully.
#
ntfsinfo -m /dev/sda5|grep Cluster
Cluster Size: 4096 Volume Size in Clusters: 9765624 Compression Block Clusters: 0 Free Clusters: 2631945 (27.0%)
Equation 1. Filesystem size in sectors
Equation 2. End sector of new partition
ntfs
filesystem on /dev/sda
. Using the s
after the number ensures parted
uses sectors as the unit.
#
parted /dev/sda
GNU Parted 3.1 Using /dev/sda Welcome to GNU Parted! Type 'help' to view a list of commands.(parted)
(parted)
rm 5(parted)
mkpart Partition name? []? windowsdisk File system type? [ext2]? ntfs Start? 232384512s End? 310509504s(parted)
quit
parted
.
(parted)
print free Model: ATA ST9320328CS (scsi) Disk /dev/sda: 320GB Sector size (logical/physical): 512B/512B Partition Table: gpt Disk Flags: pmbr_boot Number Start End Size File system Name Flags 17.4kB 1049kB 1031kB Free Space 1 1049kB 211MB 210MB fat16 EFI System Partition boot 2 211MB 735MB 524MB ext4 3 735MB 119GB 118GB 4 119GB 119GB 134MB Microsoft reserved partition msftres 5 119GB 159GB 40.0GB ntfs 159GB 215GB 56.2GB Free Space(parted)
quit
/boot/grub2/grub.cfg
.
/boot/efi/EFI/fedora/grub.cfg
.
Do not edit GRUB configurations directly!
/boot
partition. Operating systems such as Windows cannot be booted directly, but GRUB can identify and chainload them.
target
, a hardware issue to work around with a kernel parameter
, or a problem to resolve by selecting an alternate kernel. This section covers the procedure for adding boot arguments, see Section 8, “Boot Options” for some arguments you might use.
The Rescue option
initramfs
, or initial boot filesystem. This host-only
initramfs
had information only about the hardware on your computer, allowing the system to boot more quickly by avoid loading unneeded drivers.
rescue
entry. This will load the same Fedora environment as the other entries, but loads a full initramfs
.
initramfs
for all boot entries using this command:
#
dracut --regenerate-all --force
linuxefi
, or on BIOS systems the line will begin with linux
. The next argument on the line will typically be the kernel, a string beginning with /vmlinuz-
. This is shown in Figure 3, “The GRUB edit screen, Part 1”.
Getting more information during boot
rghb
and quiet
. These enable the boot splash screen instead of showing details about services, mountpoints, and other units as the sytem boots. If you are troubleshooting a boot issue or want to see more information when Fedora loads, removing these parameters will disable the splash screen.
The boot menu does not include an available operating systems. |
The bootloader has been overwritten during installation of Windows or another operating system. |
You have chosen not to use anaconda to install grub. |
grub2-mkconfig
utility. The program will scan your system and create menu entries for what it finds. You should also use grub2-mkconfig
after customizing menu entries, a process described in Section 5.4, “Configuring the GRUB Bootloader”
#
grub2-mkconfig -o /boot/grub2/grub.cfg
#
grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
/etc/default/grub
/etc/default/grub
. The default options used when creating new entries for Fedora can also be found here.
/etc/grub.d/
/etc/grub.d
are used as templates for creating new GRUB entries as well as custom boot entries.
/boot
/boot
directory contains Fedora's kernel and initramfs
.
/boot/efi/EFI
/boot/efi/EFI
.
GRUB_CMDLINE_LINUX
in /etc/default/grub
.
GRUB_CMDLINE_LINUX
and regenerating grub.cfg
will apply the parameter to all current and future Fedora boot entries.
Example 1. In practice: Fixing backlight issues with kernel parameters
acpi_backlight=vendor
parameter.
/etc/default/grub
.
#
nano /etc/default/grub
GRUB_TIMEOUT=0 GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)" GRUB_DEFAULT=saved GRUB_DISABLE_SUBMENU=true GRUB_TERMINAL_OUTPUT="console" GRUB_CMDLINE_LINUX="vconsole.font=latarcyrheb-sun16 $([ -x /usr/sbin/rhcrashkernel-param ] && /usr/sbin/rhcrashkernel-param || :) vconsole.keymap=us rhgb quiet" GRUB_DISABLE_RECOVERY="true"
GRUB_CMDLINE_LINUX
and save the file.
GRUB_TIMEOUT=0 GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)" GRUB_DEFAULT=saved GRUB_DISABLE_SUBMENU=true GRUB_TERMINAL_OUTPUT="console" GRUB_CMDLINE_LINUX="vconsole.font=latarcyrheb-sun16 $([ -x /usr/sbin/rhcrashkernel-param ] && /usr/sbin/rhcrashkernel-param || :) vconsole.keymap=us rhgb quiet acpi_backlight=vendor" GRUB_DISABLE_RECOVERY="true"
#
grub2-mkconfig -o /boot/grub/grub2.cfg
#
grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
Revision History | |||
---|---|---|---|
Revision 0-0 | Sun Jul 14 2013 | ||
|