TweetThis Button

GNU Grub Manual 2.00 ~ RC1

GNU GRUB manual 2.00 ~ RC1

Daftar Isi


Selanjutnya: , Up: (dir)

GNU GRUB pengguna

Ini adalah dokumentasi GNU GRUB, Unified Bootloader GRand, boot fleksibel dan kuat loader program untuk berbagai arsitektur.
Edisi ini dokumen versi 2.00 ~ RC1.
Panduan ini adalah untuk GNU GRUB (versi 2.00 ~ RC1, 23 Juni 2012).
Hak Cipta © 1999,2000,2001,2002,2004,2006,2008,2009,2010,2011,2012 Free Software Foundation, Inc
Izin diberikan untuk menyalin, mendistribusikan dan / atau memodifikasi dokumen ini di bawah syarat-syarat Lisensi Dokumentasi Bebas GNU, Versi 1.2 atau versi yang lebih baru yang diterbitkan oleh Free Software Foundation; tanpa Bagian Invarian.

Selanjutnya: , Sebelumnya: Top , Up: Top

1 Pengantar GRUB


Selanjutnya: , Up: Pendahuluan

1.1 Ikhtisar

Secara singkat, boot loader adalah program software pertama yang berjalan ketika komputer dimulai. Hal ini bertanggung jawab untuk loading dan transfer kontrol untuk perangkat lunak sistem operasi kernel (seperti Linux atau GNU Mach). Kernel, pada gilirannya, menginisialisasi sisa dari sistem operasi (misalnya sistem GNU).
GNU GRUB adalah boot loader yang sangat kuat, yang dapat memuat berbagai sistem operasi bebas, serta sistem operasi berpemilik dengan rantai-loading 1 . GRUB dirancang untuk mengatasi kompleksitas booting komputer pribadi, baik program dan manual ini erat terikat dengan platform komputer, meskipun port ke platform lainnya dapat diatasi di masa depan.
Salah satu fitur penting dalam GRUB adalah fleksibilitas, GRUB memahami filesystem dan format kernel dieksekusi, sehingga Anda dapat memuat sistem operasi sewenang-wenang seperti yang Anda suka, tanpa merekam posisi fisik kernel pada disk. Dengan demikian Anda dapat memuat kernel hanya dengan menentukan nama file dan drive dan partisi mana kernel berada.
Ketika boot dengan GRUB, Anda dapat menggunakan salah satu antarmuka baris perintah (lihat Command-line interface ), atau antarmuka menu (lihat menu antarmuka ). Menggunakan antarmuka baris perintah, Anda mengetik spesifikasi drive dan nama file dari kernel secara manual. Dalam antarmuka menu, Anda hanya memilih OS menggunakan tombol panah. Menu ini didasarkan pada sebuah file konfigurasi yang Anda siapkan terlebih dahulu (lihat Konfigurasi ). Sementara di menu, Anda dapat beralih ke modus baris perintah, dan sebaliknya. Anda bahkan dapat mengedit entri menu sebelum menggunakannya.
Dalam bab-bab berikut, Anda akan belajar bagaimana untuk menentukan drive, partisi, dan nama file (lihat Penamaan konvensi ) ke GRUB, cara menginstal GRUB pada drive Anda (lihat Instalasi ), dan bagaimana untuk boot OS Anda (lihat Booting ), langkah demi langkah.

Selanjutnya: , Sebelumnya: Ikhtisar , Up: Pendahuluan

1.2 Sejarah GRUB

GRUB berasal pada tahun 1995 ketika Erich Boleyn mencoba untuk boot GNU Hurd dengan University of 4 mikrokernel Mach Utah (sekarang dikenal sebagai GNU Mach). Erich dan Brian Ford merancang Spesifikasi Multiboot (lihat Multiboot Spesifikasi ), karena mereka bertekad untuk tidak menambah jumlah besar metode PC saling bertentangan-booting.
Erich kemudian mulai memodifikasi boot loader FreeBSD sehingga akan mengerti Multiboot. Dia segera menyadari bahwa akan jauh lebih mudah untuk menulis boot loader sendiri dari awal daripada tetap bekerja pada boot loader FreeBSD, dan sebagainya GRUB lahir.
Erich menambahkan banyak fitur untuk GRUB, namun prioritas lain mencegah dia dari menjaga dengan tuntutan-cepat berkembang basis pengguna. Pada tahun 1999, Gordon Matzigkeit dan Yoshinori K. Okuji mengadopsi GRUB sebagai paket GNU resmi, dan membuka perkembangannya dengan membuat sumber terbaru yang tersedia melalui CVS anonim. Lihat Mendapatkan dan Membangun GRUB , untuk informasi lebih lanjut.
Selama beberapa tahun ke depan, GRUB diperpanjang untuk memenuhi kebutuhan banyak, tapi dengan cepat menjadi jelas bahwa desain tidak menjaga dengan ekstensi yang dibuat untuk itu, dan kami mencapai titik di mana itu sangat sulit untuk membuat perubahan selanjutnya tanpa melanggar fitur yang ada. Sekitar tahun 2002, Yoshinori K. Okuji mulai bekerja pada pupa (Preliminary Pemrograman Arsitektur Universal untuk GNU GRUB), yang bertujuan untuk menulis ulang inti dari GRUB untuk membuatnya lebih bersih, lebih aman, lebih kuat, dan lebih kuat. Pupa akhirnya berganti nama menjadi GRUB 2, dan versi asli dari GRUB ini berganti nama menjadi Legacy GRUB. Sejumlah kecil pemeliharaan terus dilakukan pada Legacy GRUB, tapi rilis terakhir (0,97) dibuat pada tahun 2005 dan pada saat penulisan tampaknya tidak mungkin bahwa akan ada lagi.
Dengan sekitar 2007, GNU / Linux distribusi mulai menggunakan GRUB 2 untuk luasan yang terbatas, dan pada akhir tahun 2009 distribusi utama multipel menginstal secara default.

Selanjutnya: , Sebelumnya: Sejarah , Up: Pendahuluan

1.3 Perbedaan dari versi sebelumnya

GRUB 2 merupakan penulisan ulang dari GRUB (lihat History ), meskipun berbagi banyak karakteristik dengan versi sebelumnya, sekarang dikenal sebagai Legacy GRUB. Pengguna Legacy GRUB mungkin perlu beberapa petunjuk untuk menemukan jalan mereka di sekitar versi baru ini.
  • File konfigurasi memiliki nama baru (grub.cfg bukan menu.lst atau grub.conf), sintaks baru (lihat Konfigurasi ) dan perintah baru (lihat Perintah ). Konfigurasi tidak dapat disalin secara langsung, meskipun pengguna GRUB Legacy paling tidak harus menemukan sintaks terlalu mengejutkan.
  • grub.cfg biasanya otomatis dihasilkan oleh grub-mkconfig (lihat konfigurasi Simple ). Hal ini membuat lebih mudah untuk menangani upgrade kernel berversi.
  • Partisi angka dalam nama perangkat GRUB sekarang mulai 1, bukan 0 (lihat konvensi Penamaan ).
  • File konfigurasi sekarang ditulis dalam sesuatu yang lebih dekat ke bahasa scripting penuh: variabel, conditional, dan loop yang tersedia.
  • Sejumlah kecil penyimpanan persisten tersedia di reboot, menggunakan perintah save_env dan load_env di GRUB dan utilitas grub-editenv. Hal ini tidak tersedia di semua konfigurasi (lihat blok Lingkungan ).
  • GRUB 2 memiliki cara yang lebih dapat diandalkan untuk menemukan file sendiri dan orang-orang dari kernel target pada beberapa sistem-disk, dan memiliki perintah (lihat pencarian ) untuk menemukan perangkat yang menggunakan label sistem file atau Universally Unique Identifier (UUIDs).
  • GRUB 2 adalah tersedia untuk beberapa jenis lainnya dari sistem selain sistem BIOS PC didukung oleh GRUB Legacy: PC EFI, PC Coreboot, PowerPC, SPARC, dan MIPS Lemote Yeeloong semua didukung.
  • Sistem file banyak lagi yang didukung, termasuk namun tidak terbatas pada ext4, HFS +, dan NTFS.
  • GRUB 2 dapat membaca file langsung dari perangkat LVM dan RAID.
  • Sebuah terminal grafis dan sistem menu grafis yang tersedia.
  • Antarmuka GRUB 2 ini dapat diterjemahkan, termasuk nama entri menu.
  • File gambar tersebut (lihat Gambar ) yang membentuk GRUB telah direorganisasi, Tahap 1, Tahap 1,5, dan Tahap 2 tidak lebih.
  • GRUB 2 menempatkan banyak fasilitas dalam modul dimuat secara dinamis, yang memungkinkan gambar inti lebih kecil, dan memungkinkan gambar inti yang akan dibangun dengan cara-cara yang lebih fleksibel.

Selanjutnya: , Sebelumnya: Perubahan dari Legacy GRUB , Up: Pendahuluan

1,4 GRUB fitur

Persyaratan utama untuk GRUB adalah bahwa hal itu menjadi sesuai dengan Spesifikasi Multiboot, yang dijelaskan dalam Spesifikasi Multiboot .
Tujuan lainnya, tercantum dalam urutan perkiraan penting, adalah:
  • Fungsi dasar harus mudah bagi pengguna akhir.
  • Fungsionalitas yang kaya untuk mendukung kernel ahli dan desainer.
  • Kompatibilitas untuk boot FreeBSD, NetBSD, OpenBSD, dan Linux. Kernel Proprietary (seperti DOS, Windows NT, dan OS / 2) yang didukung melalui fungsi rantai-loading.
Kecuali untuk mode kompatibilitas tertentu (chain-loading dan format piggyback Linux), semua kernel akan dimulai dalam banyak keadaan yang sama seperti dalam Spesifikasi Multiboot. Hanya kernel dimuat pada 1 megabyte atau di atas saat ini didukung. Setiap usaha untuk memuat batas bawah yang hanya akan mengakibatkan kegagalan segera dan pesan kesalahan pelaporan masalah.
Selain persyaratan di atas, GRUB memiliki beberapa fitur berikut (perhatikan bahwa Spesifikasi Multiboot tidak memerlukan semua fitur yang mendukung GRUB):
Kenali format executable beberapa
Mendukung banyak varian a.out ditambah ELF. Tabel simbol juga dimuat.
Mendukung non-Multiboot kernel
Mendukung banyak gratis berbagai 32-bit kernel yang kurang Multiboot kepatuhan (terutama FreeBSD, NetBSD, OpenBSD, dan Linux). Rantai-pemuatan boot loader lainnya juga didukung.
Beban kelipatan modul
Sepenuhnya mendukung fitur Multiboot loading beberapa modul.
Memuat file konfigurasi
Mendukung manusia-dibaca teks file konfigurasi dengan perintah boot preset. Anda juga dapat memuat file konfigurasi lain secara dinamis dan menanamkan file konfigurasi telah diatur dalam sebuah file gambar GRUB. Daftar perintah (lihat Perintah ) adalah superset dari yang didukung pada baris perintah-. Sebuah file konfigurasi contoh disediakan dalam Konfigurasi .
Menyediakan antarmuka menu
Sebuah antarmuka daftar menu perintah boot preset, dengan batas waktu diprogram, tersedia. Tidak ada batasan tetap pada jumlah entri boot, dan implementasi saat ini memiliki ruang untuk beberapa ratus.
Memiliki antarmuka baris perintah yang fleksibel
Sebuah antarmuka baris perintah yang cukup fleksibel, dapat diakses dari menu, tersedia untuk mengedit perintah preset, atau menulis perintah boot baru ditetapkan dari awal. Jika tidak ada file konfigurasi hadir, GRUB turun ke baris perintah-. Daftar perintah (lihat Perintah ) adalah subset dari mereka yang didukung untuk file konfigurasi. Mengedit perintah mirip dengan Bash baris perintah (lihat Bash ), dengan -penyelesaian perintah, perangkat, partisi, dan file dalam sebuah direktori tergantung pada konteks.
Mendukung jenis filesystem beberapa
Mendukung jenis filesystem beberapa transparan, ditambah notasi blocklist berguna eksplisit. Jenis filesystem saat ini didukung adalah Amiga Cepat FileSystem (AFFS), AtheOS fs, BeFS, BtrFS (termasuk RAID0, RAID1, RAID10, gzip dan lzo), cpio (bin kecil-dan besar-endian, ODC dan varian newc), Linux ext2 / ext3/ext4, DOS FAT12/FAT16/FAT32, ExFAT, HFS, HFS +, ISO9660 (termasuk Joliet, Rock-ridge dan multi-potongan file), JFS, Minix fs (versi 1, 2 dan 3), nilfs2, NTFS ( termasuk kompresi), ReiserFS, ROMFS, Amiga Cerdas FileSystem (SFS),, Squash4 tar, UDF, BSD UFS/UFS2, XFS, ZFS dan (termasuk lzjb, gzip, zle, cermin, stripe, raidz1/2/3 dan enkripsi AES-CCM dan AES-GCM). Lihat Filesystem , untuk informasi lebih lanjut.
Dukungan dekompresi otomatis
Dapat dekompresi file yang dikompresi dengan gzip atau xz 2 . Fungsi ini baik otomatis dan transparan kepada pengguna (yaitu semua fungsi beroperasi pada isi terkompresi dari file yang ditentukan). Ini sangat mengurangi ukuran file dan waktu loading, manfaat sangat besar untuk disket. 3 Bisa dibayangkan bahwa beberapa modul kernel harus dimuat dalam keadaan terkompresi, sehingga perintah modul-pembebanan yang berbeda dapat ditentukan untuk menghindari Uncompressing modul.
Akses data pada perangkat diinstal
Dukungan membaca data dari disket setiap atau semua atau hard disk (s) diakui oleh BIOS, independen dari pengaturan perangkat root.
Jadilah independen dari terjemahan geometri drive
Tidak seperti banyak boot loader lainnya, GRUB membuat terjemahan drive tertentu tidak relevan. Sebuah drive yang terpasang dan berjalan dengan satu terjemahan dapat dikonversi menjadi terjemahan lain tanpa efek samping atau perubahan dalam konfigurasi GRUB.
Mendeteksi semua ram diinstal
GRUB umumnya dapat menemukan semua ram diinstal pada mesin PC yang kompatibel. Ini menggunakan teknik BIOS permintaan canggih untuk menemukan semua daerah memori. Seperti dijelaskan pada Spesifikasi Multiboot (lihat Multiboot Spesifikasi ), tidak semua kernel menggunakan informasi ini, tapi GRUB menyediakan untuk orang-orang yang melakukan.
Mendukung modus Block Alamat Logis
Dalam panggilan disk tradisional (disebut CHS mode), ada terjemahan geometri masalah, yaitu, BIOS tidak dapat mengakses lebih dari 1024 silinder, sehingga ruang dapat diakses terbatas untuk setidaknya 508 MB dan paling 8GB. GRUB tidak bisa universal memecahkan masalah ini, karena tidak ada antarmuka standar yang digunakan di semua mesin. Namun, mesin baru beberapa memiliki antarmuka Alamat, Block baru Logical (LBA) mode. GRUB secara otomatis mendeteksi jika modus LBA tersedia dan menggunakannya jika tersedia. Dalam modus LBA, GRUB dapat mengakses seluruh disk.
Dukungan jaringan boot
GRUB pada dasarnya adalah sebuah boot loader berbasis disk tetapi juga memiliki dukungan jaringan. Anda dapat memuat gambar OS dari jaringan dengan menggunakan protokol TFTP.
Dukungan remote terminal
Untuk mendukung komputer dengan konsol tidak, GRUB menyediakan dukungan remote terminal, sehingga Anda dapat mengontrol GRUB dari host remote. Hanya mendukung terminal serial diimplementasikan saat ini.

Sebelumnya: Fitur , Up: Pendahuluan

1.5 Peran boot loader

Berikut ini adalah kutipan dari Gordon Matzigkeit, seorang fanatik GRUB:
Beberapa orang ingin mengakui kedua sistem operasi dan kernel ketika mereka berbicara tentang komputer mereka, sehingga mereka mungkin mengatakan mereka menggunakan "GNU / Linux" atau "GNU / Hurd". Orang lain tampaknya berpikir bahwa kernel adalah bagian paling penting dari sistem, sehingga mereka suka menyebutnya sistem operasi GNU mereka "sistem Linux." Saya, secara pribadi, percaya bahwa ini adalah kuburan ketidakadilan, karena boot loader adalah perangkat lunak yang paling penting dari semua. Aku digunakan untuk merujuk kepada sistem di atas sebagai "LILO" 4 atau "GRUB" sistem.
Sayangnya, tidak ada yang pernah mengerti apa yang saya bicarakan, sekarang saya hanya menggunakan kata "GNU" sebagai nama samaran untuk GRUB.
Jadi, jika Anda pernah mendengar orang berbicara tentang dugaan mereka sistem "GNU", ingatlah bahwa mereka benar-benar membayar penghormatan kepada boot loader terbaik di sekitar ... GRUB!
Kami, para pengelola GRUB, tidak (biasanya) mendorong tingkat Gordon fanatisme, tetapi hal ini membantu untuk mengingat bahwa boot loader pantas pengakuan. Kami berharap bahwa Anda senang menggunakan GRUB GNU sebanyak seperti yang kita lakukan menulisnya.

Selanjutnya: , Sebelumnya: Pendahuluan , Up: Top

2 Penamaan konvensi

Sintaks perangkat yang digunakan dalam GRUB adalah wee bit berbeda dari apa yang Anda mungkin telah melihat sebelumnya dalam sistem operasi Anda (s), dan Anda perlu tahu sehingga Anda dapat menentukan drive / partisi.
Lihatlah contoh-contoh berikut dan penjelasan:
  (Fd0)
Pertama-tama, GRUB mensyaratkan bahwa nama perangkat dilampiri dengan '(' dan ')'. Bagian 'fd' berarti bahwa itu adalah floppy disk. '0' nomor adalah nomor drive, yang dihitung dari nol. Ungkapan ini berarti bahwa GRUB akan menggunakan floppy disk secara keseluruhan.
  (Hd0, msdos2)
Di sini, 'hd' berarti itu adalah hard disk drive. Integer pertama '0' menunjukkan jumlah drive, yaitu, hard disk pertama, 'msdos' string menunjukkan skema partisi, sedangkan integer kedua, '2', menunjukkan nomor partisi (atau slice pc nomor dalam BSD terminologi). Nomor partisi akan dihitung dari satu, bukan dari nol (seperti yang terjadi di versi sebelumnya dari GRUB). Ungkapan ini berarti partisi kedua dari hard disk drive pertama. Dalam kasus ini, GRUB menggunakan satu partisi dari disk, bukan seluruh disk.
  (Hd0, msdos5)
Ini menentukan partisi extended pertama dari hard disk drive pertama. Perhatikan bahwa nomor partisi untuk partisi extended dihitung dari '5', terlepas dari jumlah sebenarnya dari partisi primer pada hard disk Anda.
  (Hd1, msdos1, bsd1)
Ini berarti 'a' BSD partisi pada slice pc angka pertama dari hard disk kedua.
Tentu saja, untuk benar-benar mengakses disk atau partisi dengan GRUB, Anda perlu menggunakan spesifikasi perangkat dalam perintah, seperti 'root set = (fd0)' atau 'parttool (hd0, msdos3) sembunyi-'. Untuk membantu Anda mengetahui nomor menentukan partisi yang Anda inginkan, GRUB baris perintah (lihat Command-line interface ) memiliki opsi penyelesaian argumen. Ini berarti bahwa, misalnya, Anda hanya perlu mengetikkan
  set = root (
diikuti oleh , dan GRUB akan menampilkan daftar drive, partisi, atau nama file. Jadi harus cukup mudah untuk menentukan nama partisi target Anda, bahkan dengan pengetahuan yang minim tentang sintaks.
Perhatikan bahwa GRUB tidak membedakan IDE dari SCSI - itu hanya menghitung nomor berkendara dari nol, terlepas dari jenis mereka. Biasanya, setiap nomor drive IDE kurang dari sejumlah drive SCSI, meskipun itu tidak benar jika Anda mengubah urutan boot dengan menukar IDE dan drive SCSI di BIOS.
Sekarang pertanyaannya adalah, bagaimana menentukan sebuah file? Sekali lagi, pertimbangkan contoh:
  (Hd0, msdos1) / vmlinuz
Ini menentukan file bernama 'vmlinuz', ditemukan pada partisi pertama dari hard disk drive pertama. Perhatikan bahwa penyelesaian argumen bekerja dengan nama file, juga.
Itu mudah, mengakuinya. Sekarang membaca bab berikutnya, untuk mengetahui bagaimana sebenarnya menginstal GRUB pada drive Anda.

Selanjutnya: , Sebelumnya: Penamaan konvensi , Up: Top

3 Instalasi

Dalam rangka untuk menginstal GRUB sebagai boot loader Anda, Anda harus terlebih dahulu menginstal sistem GRUB dan utilitas di bawah UNIX-seperti sistem operasi Anda (lihat Mendapatkan dan Bangunan GRUB ). Anda dapat melakukan hal ini baik dari tarball source, atau sebagai paket untuk OS Anda.
Setelah Anda melakukan itu, Anda perlu menginstal boot loader pada drive (floppy disk atau hard) dengan menggunakan utilitas grub-install (lihat Menjalankan grub-install ) pada UNIX-seperti OS.
GRUB dilengkapi dengan gambar boot, yang biasanya diletakkan di direktori / usr / lib / grub / - (untuk BIOS-mesin berbasis / usr/lib/grub/i386-pc). Akhirat, direktori tempat gambar GRUB pada awalnya ditempatkan (biasanya / usr / lib / grub / - ) akan dipanggil direktori gambar, dan direktori di mana boot loader perlu menemukan mereka (biasanya / boot) akan disebut direktori boot.

3.1 Instalasi GRUB menggunakan grub-install

Untuk informasi di mana GRUB harus diinstal pada platform PC BIOS, lihat instalasi BIOS .
Dalam rangka untuk menginstal GRUB di bawah UNIX-seperti OS (seperti gnu), menjalankan program grub-install (lihat Menjalankan grub-install ) sebagai superuser (root).
Penggunaan pada dasarnya sangat sederhana. Anda hanya perlu menentukan satu argumen untuk program tersebut, yaitu, di mana untuk menginstal boot loader. Argumen harus berupa file device (seperti '/ dev / hda'). Sebagai contoh, di Linux berikut ini akan menginstal GRUB ke MBR dari disk IDE pertama:
  # Grub-install / dev / hda
Demikian juga, di bawah GNU / Hurd, ini memiliki efek yang sama:
  # Grub-install / dev/hd0
Tapi semua contoh di atas mengasumsikan bahwa GRUB harus menempatkan gambar di bawah direktori / boot. Jika Anda ingin GRUB untuk menempatkan gambar di bawah direktori selain / boot, Anda perlu menentukan opsi - boot-directory. Penggunaan yang khas adalah bahwa Anda membuat disket boot GRUB dengan filesystem. Berikut adalah contoh:
  # Mke2fs / dev/fd0
      # Mount-t ext2 / dev/fd0 / mnt
      # Mkdir / mnt / boot
      # Grub-install - boot-directory = / mnt / boot / dev/fd0
      # Umount / mnt
Beberapa BIOS memiliki bug exposing partisi pertama dari drive USB sebagai disket bukan mengekspos USB drive sebagai hard disk (mereka menyebutnya "USB-FDD" boot). Dalam kasus tersebut, Anda perlu menginstal seperti ini:
  # Losetup / dev/loop0 / dev/sdb1
      # Mount / dev/loop0 / mnt / usb
      # Grub-install - boot-directory = / mnt / usb / bugbios - force - memungkinkan-floppy / dev/loop0
Install ini tidak bertentangan dengan standar instalasi selama mereka berada dalam direktori terpisah.
Perhatikan bahwa grub-install sebenarnya hanya shell script dan tugas yang sebenarnya dilakukan oleh grub-mkimage dan grub-setup. Oleh karena itu, Anda dapat menjalankan perintah-perintah tersebut secara langsung untuk menginstal GRUB, tanpa menggunakan grub-install. Jangan lakukan itu, bagaimanapun, kecuali Anda sangat akrab dengan internal GRUB. Instalasi boot loader pada OS yang berjalan mungkin sangat berbahaya.

3.2 Membuat GRUB CD-ROM bootable

GRUB mendukung modus emulasi tidak ada di El Torito spesifikasi 5 . Ini berarti bahwa Anda dapat menggunakan seluruh CD-ROM dari GRUB dan Anda tidak perlu membuat file disk image floppy atau hard, yang dapat menyebabkan masalah kompatibilitas.
Untuk booting dari CD-ROM, GRUB menggunakan gambar khusus yang disebut cdboot.img, yang concatenated dengan core.img. The core.img digunakan untuk ini harus dibangun dengan setidaknya 'iso9660' dan 'biosdisk' modul. Bootable CD-ROM biasanya akan juga perlu menyertakan file konfigurasi grub.cfg dan beberapa modul GRUB lainnya.
Untuk membuat CD GRUB penyelamatan umum dan sederhana, Anda dapat menggunakan program grub-mkrescue (lihat Menjalankan grub-mkrescue ):
  $ Grub-mkrescue-o grub.iso
Anda akan sering perlu untuk menyertakan file lain dalam gambar Anda. Untuk melakukan ini, pertama buat direktori teratas untuk citra bootable, katakanlah, 'iso':
  $ Mkdir iso
Buatlah sebuah direktori untuk GRUB:
  $ Mkdir-p iso / boot / grub
Jika diinginkan, membuat grub.cfg file konfigurasi di bawah iso / boot / grub (lihat Konfigurasi ), dan menyalin file dan direktori untuk disk ke direktori iso /.
Akhirnya, membuat gambar:
  $ Grub-mkrescue-o grub.iso iso
Ini menghasilkan sebuah file bernama grub.iso, yang kemudian dapat dibakar ke CD (atau DVD), atau ditulis ke perangkat penyimpanan massal USB.
Perangkat root akan dibentuk tepat memasuki file konfigurasi grub.cfg Anda, sehingga Anda dapat merujuk ke nama file pada CD tanpa perlu menggunakan nama perangkat eksplisit. Hal ini membuat lebih mudah untuk menghasilkan gambar penyelamatan yang akan bekerja pada kedua drive optik dan perangkat USB mass storage.

Selanjutnya: , Sebelumnya: Membuat GRUB CD-ROM bootable , Up: Instalasi

3.3 peta antara drive BIOS dan OS perangkat

Jika file peta perangkat ada, utilitas GRUB (grub-probe, grub-setup, dll) membacanya untuk drive peta BIOS ke perangkat OS. File ini terdiri dari baris seperti ini:
  (Device) file
perangkat berjarak ditentukan dalam sintaks GRUB (lihat sintaks Perangkat ), dan file adalah file OS, yang biasanya merupakan file device.
Secara historis, file peta perangkat digunakan karena GRUB nama perangkat harus digunakan dalam file konfigurasi, dan mereka berasal dari nomor berkendara BIOS. Peta antara drive BIOS dan perangkat OS tidak selalu dapat menebak dengan benar: misalnya, GRUB akan mendapatkan urutan yang salah jika Anda bertukar urutan booting antara IDE dan SCSI di BIOS.
Sayangnya, bahkan OS nama perangkat tidak selalu stabil. Versi modern dari kernel Linux dapat menyelidiki drive dalam urutan yang berbeda dari boot untuk boot, dan awalan (/ dev / hd * terhadap / dev / sd *) dapat berubah tergantung pada subsistem pengemudi digunakan. Akibatnya, file peta perangkat yang diperlukan editing sering pada beberapa sistem.
GRUB menghindari masalah ini saat ini dengan menggunakan UUIDs atau label sistem file saat membuat grub.cfg, dan kami menyarankan Anda melakukan hal yang sama untuk setiap entri menu kustom yang Anda tulis. Jika file peta perangkat tidak ada, maka utilitas GRUB akan menganggap peta perangkat sementara on the fly. Hal ini sering cukup baik, khususnya dalam kasus umum tunggal-disk sistem.
Namun, file peta perangkat tidak sepenuhnya usang belum, dan itu digunakan untuk mengesampingkan ketika lingkungan saat ini berbeda dengan saat boot. Kasus yang paling umum adalah jika Anda menggunakan partisi atau volume logis sebagai disk untuk mesin virtual. Anda dapat menempatkan setiap komentar di file jika diperlukan, sebagai utilitas GRUB berasumsi bahwa garis hanya komentar jika karakter pertama adalah '#'.

Sebelumnya: peta Perangkat , Up: Instalasi

3.4 BIOS instalasi

MBR

Tabel partisi Format tradisional digunakan pada platform PC BIOS disebut Master Boot Record (MBR) format, ini adalah format yang memungkinkan hingga empat partisi primer dan partisi logical tambahan. Dengan format tabel partisi, ada dua cara untuk menginstal GRUB: dapat tertanam di daerah antara MBR dan partisi pertama (disebut dengan berbagai nama, seperti "track boot", "kesenjangan MBR", atau "embedding daerah ", dan yang biasanya setidaknya 31 KiB), atau gambar inti dapat diinstal dalam sistem file dan daftar blok yang membuat itu dapat disimpan dalam sektor pertama dari partisi itu.
Masing-masing memiliki masalah yang berbeda. Tidak ada cara untuk memesan ruang di wilayah embedding dengan keselamatan lengkap, dan beberapa perangkat lunak berpemilik diketahui menggunakannya untuk membuat sulit bagi pengguna untuk bekerja di sekitar pembatasan perizinan, dan sistem kadang-kadang dipartisi tanpa meninggalkan ruang yang cukup sebelum partisi pertama. Di sisi lain, menginstall filesystem berarti GRUB yang rentan terhadap blok yang dipindahkan sekitar dengan fitur filesystem seperti kemasan ekor, atau bahkan dengan implementasi fsck agresif, sehingga pendekatan ini cukup rapuh, dan pendekatan ini hanya dapat digunakan jika filesystem / boot pada disk yang sama bahwa boot BIOS dari, sehingga GRUB yang tidak harus bergantung pada menebak angka BIOS drive.
Tim pengembangan GRUB umumnya merekomendasikan embedding GRUB sebelum partisi pertama, kecuali jika Anda memiliki persyaratan khusus. Anda harus memastikan bahwa partisi pertama dimulai setidaknya 31 KiB (63 sektor) dari awal disk, di disk modern, sering keuntungan kinerja untuk menyelaraskan partisi pada batas-batas yang lebih besar pula, sehingga partisi pertama mungkin mulai 1 MiB dari awal disk.

GPT

Beberapa sistem baru menggunakan Partition GUID Tabel (GPT) format. Hal ini ditetapkan sebagai bagian dari Extensible Firmware Interface (EFI), tetapi juga dapat digunakan pada platform BIOS jika perangkat lunak sistem mendukung itu, misalnya, GRUB dan GNU / Linux dapat digunakan dalam konfigurasi ini. Dengan format ini, adalah mungkin untuk cadangan seluruh partisi untuk GRUB, disebut Partisi Boot BIOS. GRUB kemudian dapat dimasukkan ke dalam partisi yang tanpa risiko sedang ditimpa oleh perangkat lunak lain dan tanpa terkandung dalam filesystem yang mungkin memindahkan blok sekitar.
Ketika membuat partisi BIOS Boot pada sistem GPT, Anda harus memastikan bahwa itu setidaknya 31 KiB dalam ukuran. (GPT-diformat disk biasanya tidak sangat kecil, jadi kami sarankan Anda membuatnya lebih besar daripada minimal, seperti 1 MiB, untuk memungkinkan banyak ruang untuk pertumbuhan.) Anda juga harus memastikan bahwa ia memiliki jenis partisi yang tepat . Menggunakan GNU Parted, Anda dapat mengatur ini menggunakan perintah seperti berikut:
  # Parted / dev / set disk partisi-nomor pada bios_grub
Jika Anda menggunakan gDisk, mengatur tipe partisi '0xEF02'. Dengan partisi program yang membutuhkan pengaturan GUID secara langsung, itu harus '21686148-6449-6e6f-744e656564454649'.
Perhatian: Berhati-hatilah partisi yang Anda pilih! Ketika GRUB menemukan Partisi Boot BIOS saat instalasi, maka secara otomatis akan menimpa bagian dari itu. Pastikan bahwa partisi tidak berisi data lainnya.

Next: , Previous: Installation , Up: Top

4 Booting

GRUB can load Multiboot-compliant kernels in a consistent way, but for some free operating systems you need to use some OS-specific magic.

4.1 How to boot operating systems

GRUB has two distinct boot methods. One of the two is to load an operating system directly, and the other is to chain-load another boot loader which then will load an operating system actually. Generally speaking, the former is more desirable, because you don't need to install or maintain other boot loaders and GRUB is flexible enough to load an operating system from an arbitrary disk/partition. However, the latter is sometimes required, since GRUB doesn't support all the existing operating systems natively.

4.1.1 How to boot an OS directly with GRUB

Multiboot (see Multiboot Specification ) is the native format supported by GRUB. For the sake of convenience, there is also support for Linux, FreeBSD, NetBSD and OpenBSD. If you want to boot other operating systems, you will have to chain-load them (see Chain-loading ).
FIXME: this section is incomplete.
  1. Run the command boot (see boot ).
However, DOS and Windows have some deficiencies, so you might have to use more complicated instructions. See DOS/Windows , for more information.

4.1.2 Chain-loading an OS

Operating systems that do not support Multiboot and do not have specific support in GRUB (specific support is available for Linux, FreeBSD, NetBSD and OpenBSD) must be chain-loaded, which involves loading another boot loader and jumping to it in real mode.
The chainloader command (see chainloader ) is used to set this up. It is normally also necessary to load some GRUB modules and set the appropriate root device. Putting this together, we get something like this, for a Windows system on the first partition of the first hard disk:
 menuentry "Windows" {
	insmod chain
	insmod ntfs
	 set root = (hd0, 1)
	 chainloader +1
 }
On systems with multiple hard disks, an additional workaround may be required. See DOS/Windows .
Chain-loading is only supported on PC BIOS and EFI platforms.

4.2 Loopback booting

GRUB is able to read from an image (be it one of CD or HDD) stored on any of its accessible storages (refer to see loopback command). However the OS itself should be able to find its root. This usually involves running a userspace program running before the real root is discovered. This is achieved by GRUB loading a specially made small image and passing it as ramdisk to the kernel. Hal ini dicapai dengan on the loader. Note that for knetbsd the image must be put inside miniroot.kmod and the whole miniroot.kmod has to be loaded. In kopenbsd payload this is disabled by default. Aditionally behaviour of initial ramdisk depends on command line options. Several distributors provide the image for this purpose or it's integrated in their standard ramdisk and activated by special option. Consult your kernel and distribution manual for more details. Other loaders like appleloader, chainloader (BIOS, EFI, coreboot), freedos, ntldr and plan9 provide no possibility of loading initial ramdisk and as far as author is aware the payloads in question don't support either initial ramdisk or discovering loopback boot in other way and as such not bootable this way. Please consider alternative boot methods like copying all files from the image to actual partition. Consult your OS documentation for more details

Previous: Loopback booting , Up: Booting

4.3 Some caveats on OS-specific issues

Here, we describe some caveats on several operating systems.

4.3.1 GNU/Hurd

Since GNU/Hurd is Multiboot-compliant, it is easy to boot it; there is nothing special about it. But do not forget that you have to specify a root partition to the kernel.
  1. Set GRUB's root device to the same drive as GNU/Hurd's. The command search --set=root --file /boot/gnumach.gz or similar may help you (see search ).
  2. Load the kernel and the modules, like this:
     grub> multiboot /boot/gnumach.gz root=device:hd0s1
              grub> module /hurd/ext2fs.static ext2fs --readonly \
                                 --multiboot-command-line='${kernel-command-line}' \
                                 --host-priv-port='${host-port}' \
                                 --device-master-port='${device-port}' \
                                 --exec-server-task='${exec-task}' -T typed '${root}' \
                                 '$(task-create)' '$(task-resume)'
              grub> module /lib/ld.so.1 exec /hurd/exec '$(exec-task=task-create)'
    
  3. Finally, run the command boot (see boot ).

Next: , Previous: GNU/Hurd , Up: OS-specific notes

4.3.2 GNU/Linux

It is relatively easy to boot GNU/Linux from GRUB, because it somewhat resembles to boot a Multiboot-compliant OS.
  1. Set GRUB's root device to the same drive as GNU/Linux's. The command search --set=root --file /vmlinuz or similar may help you (see search ).
  2. Load the kernel using the command linux (see linux ):
     grub> linux /vmlinuz root=/dev/sda1
    
    If you need to specify some kernel parameters, just append them to the command. For example, to set acpi to ' off ', do this:
     grub> linux /vmlinuz root=/dev/sda1 acpi=off
    
    See the documentation in the Linux source tree for complete information on the available options.
    With linux GRUB uses 32-bit protocol. Some BIOS services like APM or EDD aren't available with this protocol. In this case you need to use linux16
     grub> linux16 /vmlinuz root=/dev/sda1 acpi=off
    
  3. If you use an initrd, execute the command initrd (see initrd ) after linux :
     grub> initrd /initrd
    
    If you used linux16 you need to use initrd16 :
     grub> initrd16 /initrd
    
  4. Finally, run the command boot (see boot ).
Caution: If you use an initrd and specify the ' mem= ' option to the kernel to let it use less than actual memory size, you will also have to specify the same memory size to GRUB. To let GRUB know the size, run the command uppermem before loading the kernel. See uppermem , for more information.

Previous: GNU/Linux , Up: OS-specific notes

4.3.3 DOS/Windows

GRUB cannot boot DOS or Windows directly, so you must chain-load them (see Chain-loading ). However, their boot loaders have some critical deficiencies, so it may not work to just chain-load them. To overcome the problems, GRUB provides you with two helper functions.
If you have installed DOS (or Windows) on a non-first hard disk, you have to use the disk swapping technique, because that OS cannot boot from any disks but the first one. The workaround used in GRUB is the command drivemap (see drivemap ), like this:
 drivemap -s (hd0) (hd1)
This performs a virtual swap between your first and second hard drive.
Caution: This is effective only if DOS (or Windows) uses BIOS to access the swapped disks. If that OS uses a special driver for the disks, this probably won't work.
Another problem arises if you installed more than one set of DOS/Windows onto one disk, because they could be confused if there are more than one primary partitions for DOS/Windows. Certainly you should avoid doing this, but there is a solution if you do want to do so. Use the partition hiding/unhiding technique.
If GRUB hides a DOS (or Windows) partition (see parttool ), DOS (or Windows) will ignore the partition. If GRUB unhides a DOS (or Windows) partition, DOS (or Windows) will detect the partition. Thus, if you have installed DOS (or Windows) on the first and the second partition of the first hard disk, and you want to boot the copy on the first partition, do the following:
 parttool (hd0,1) hidden-
     parttool (hd0,2) hidden+
      set root = (hd0, 1)
      chainloader +1
     parttool ${root} boot+
      booting

Next: , Previous: Booting , Up: Top

5 Writing your own configuration file

GRUB is configured using grub.cfg , usually located under /boot/grub . This file is quite flexible, but most users will not need to write the whole thing by hand.

5.1 Simple configuration handling

The program grub-mkconfig (see Invoking grub-mkconfig ) generates grub.cfg files suitable for most cases. It is suitable for use when upgrading a distribution, and will discover available kernels and attempt to generate menu entries for them.
grub-mkconfig does have some limitations. While adding extra custom menu entries to the end of the list can be done by editing /etc/grub.d/40_custom or creating /boot/grub/custom.cfg , changing the order of menu entries or changing their titles may require making complex changes to shell scripts stored in /etc/grub.d/ . This may be improved in the future. In the meantime, those who feel that it would be easier to write grub.cfg directly are encouraged to do so (see Booting , and Shell-like scripting ), and to disable any system provided by their distribution to automatically run grub-mkconfig .
The file /etc/default/grub controls the operation of grub-mkconfig . It is sourced by a shell script, and so must be valid POSIX shell input; normally, it will just be a sequence of ' KEY=value ' lines, but if the value contains spaces or other special characters then it must be quoted. Sebagai contoh:
 GRUB_TERMINAL_INPUT="console serial"
Valid keys in /etc/default/grub are as follows:
' GRUB_DEFAULT '
The default menu entry. This may be a number, in which case it identifies the Nth entry in the generated menu counted from zero, or the title of a menu entry, or the special string ' saved '. Using the title may be useful if you want to set a menu entry as the default even though there may be a variable number of entries before it. For example, if you have:
 menuentry 'Example GNU/Linux distribution' --class gnu-linux {
     	 ...
      }
then you can make this the default using:
 GRUB_DEFAULT='Example GNU/Linux distribution'
If you set this to ' saved ', then the default menu entry will be that saved by ' GRUB_SAVEDEFAULT ', grub-set-default , or grub-reboot .
The default is ' 0 '.
' GRUB_SAVEDEFAULT '
If this option is set to ' true ', then, when an entry is selected, save it as a new default entry for use by future runs of GRUB. This is only useful if ' GRUB_DEFAULT=saved '; it is a separate option because ' GRUB_DEFAULT=saved ' is useful without this option, in conjunction with grub-set-default or grub-reboot . Diset secara default. This option relies on the environment block, which may not be available in all situations (see Environment block ).
' GRUB_TIMEOUT '
Boot the default entry this many seconds after the menu is displayed, unless a key is pressed. The default is ' 5 '. Set to ' 0 ' to boot immediately without displaying the menu, or to ' -1 ' to wait indefinitely.
' GRUB_HIDDEN_TIMEOUT '
Wait this many seconds for a key to be pressed before displaying the menu. If no key is pressed during that time, display the menu for the number of seconds specified in GRUB_TIMEOUT before booting the default entry. We expect that most people who use GRUB_HIDDEN_TIMEOUT will want to have GRUB_TIMEOUT set to ' 0 ' so that the menu is not displayed at all unless a key is pressed. Diset secara default.
' GRUB_HIDDEN_TIMEOUT_QUIET '
In conjunction with ' GRUB_HIDDEN_TIMEOUT ', set this to ' true ' to suppress the verbose countdown while waiting for a key to be pressed before displaying the menu. Diset secara default.
' GRUB_DEFAULT_BUTTON '
' GRUB_TIMEOUT_BUTTON '
' GRUB_HIDDEN_TIMEOUT_BUTTON '
' GRUB_BUTTON_CMOS_ADDRESS '
Variants of the corresponding variables without the ' _BUTTON ' suffix, used to support vendor-specific power buttons. See Vendor power-on keys .
' GRUB_DISTRIBUTOR '
Set by distributors of GRUB to their identifying name. This is used to generate more informative menu entry titles.
' GRUB_TERMINAL_INPUT '
Select the terminal input device. You may select multiple devices here, separated by spaces. Valid terminal input names depend on the platform, but may include ' console ' (PC BIOS and EFI consoles), ' serial ' (serial terminal), ' ofconsole ' (Open Firmware console), ' at_keyboard ' (PC AT keyboard, mainly useful with Coreboot), or ' usb_keyboard ' (USB keyboard using the HID Boot Protocol, for cases where the firmware does not handle this).
The default is to use the platform's native terminal input.
' GRUB_TERMINAL_OUTPUT '
Select the terminal output device. You may select multiple devices here, separated by spaces. Valid terminal output names depend on the platform, but may include ' console ' (PC BIOS and EFI consoles), ' serial ' (serial terminal), ' gfxterm ' (graphics-mode output), ' ofconsole ' (Open Firmware console), or ' vga_text ' (VGA text output, mainly useful with Coreboot).
The default is to use the platform's native terminal output.
' GRUB_TERMINAL '
If this option is set, it overrides both ' GRUB_TERMINAL_INPUT ' and ' GRUB_TERMINAL_OUTPUT ' to the same value.
' GRUB_SERIAL_COMMAND '
A command to configure the serial port when using the serial console. See serial . Defaults to ' serial '.
' GRUB_CMDLINE_LINUX '
Command-line arguments to add to menu entries for the Linux kernel.
' GRUB_CMDLINE_LINUX_DEFAULT '
Unless ' GRUB_DISABLE_RECOVERY ' is set to ' true ', two menu entries will be generated for each Linux kernel: one default entry and one entry for recovery mode. This option lists command-line arguments to add only to the default menu entry, after those listed in ' GRUB_CMDLINE_LINUX '.
' GRUB_CMDLINE_NETBSD '
' GRUB_CMDLINE_NETBSD_DEFAULT '
As ' GRUB_CMDLINE_LINUX ' and ' GRUB_CMDLINE_LINUX_DEFAULT ', but for NetBSD.
' GRUB_CMDLINE_GNUMACH '
As ' GRUB_CMDLINE_LINUX ', but for GNU Mach.
' GRUB_CMDLINE_XEN '
' GRUB_CMDLINE_XEN_DEFAULT '
The values of these options are appended to the values of ' GRUB_CMDLINE_LINUX ' and ' GRUB_CMDLINE_LINUX_DEFAULT ' for Linux and Xen menu entries.
' GRUB_CMDLINE_LINUX_XEN_REPLACE '
' GRUB_CMDLINE_LINUX_XEN_REPLACE_DEFAULT '
The values of these options replace the values of ' GRUB_CMDLINE_LINUX ' and ' GRUB_CMDLINE_LINUX_DEFAULT ' for Linux and Xen menu entries.
' GRUB_DISABLE_LINUX_UUID '
Normally, grub-mkconfig will generate menu entries that use universally-unique identifiers (UUIDs) to identify the root filesystem to the Linux kernel, using a ' root=UUID=... ' kernel parameter. This is usually more reliable, but in some cases it may not be appropriate. To disable the use of UUIDs, set this option to ' true '.
' GRUB_DISABLE_RECOVERY '
If this option is set to ' true ', disable the generation of recovery mode menu entries.
' GRUB_VIDEO_BACKEND '
If graphical video support is required, either because the ' gfxterm ' graphical terminal is in use or because ' GRUB_GFXPAYLOAD_LINUX ' is set, then grub-mkconfig will normally load all available GRUB video drivers and use the one most appropriate for your hardware. If you need to override this for some reason, then you can set this option. After grub-install has been run, the available video drivers are listed in /boot/grub/video.lst .
' GRUB_GFXMODE '
Set the resolution used on the ' gfxterm ' graphical terminal. Note that you can only use modes which your graphics card supports via VESA BIOS Extensions (VBE), so for example native LCD panel resolutions may not be available. The default is ' auto ', which tries to select a preferred resolution. See gfxmode .
' GRUB_BACKGROUND '
Set a background image for use with the ' gfxterm ' graphical terminal. The value of this option must be a file readable by GRUB at boot time, and it must end with .png , .tga , .jpg , or .jpeg . The image will be scaled if necessary to fit the screen.
' GRUB_THEME '
Set a theme for use with the ' gfxterm ' graphical terminal.
' GRUB_GFXPAYLOAD_LINUX '
Set to ' text ' to force the Linux kernel to boot in normal text mode, ' keep ' to preserve the graphics mode set using ' GRUB_GFXMODE ', ' width x height '[' x depth '] to set a particular graphics mode, or a sequence of these separated by commas or semicolons to try several modes in sequence. See gfxpayload . Depending on your kernel, your distribution, your graphics card, and the phase of the moon, note that using this option may cause GNU/Linux to suffer from various display problems, particularly during the early part of the boot sequence. If you have problems, set this option to ' text ' and GRUB will tell Linux to boot in normal text mode.
' GRUB_DISABLE_OS_PROBER '
Normally, grub-mkconfig will try to use the external os-prober program, if installed, to discover other operating systems installed on the same system and generate appropriate menu entries for them. Set this option to ' true ' to disable this.
' GRUB_INIT_TUNE '
Play a tune on the speaker when GRUB starts. This is particularly useful for users unable to see the screen. The value of this option is passed directly to play .
' GRUB_BADRAM '
If this option is set, GRUB will issue a badram command to filter out specified regions of RAM.
' GRUB_PRELOAD_MODULES '
This option may be set to a list of GRUB module names separated by spaces. Each module will be loaded as early as possible, at the start of grub.cfg .
For more detailed customisation of grub-mkconfig 's output, you may edit the scripts in /etc/grub.d directly. /etc/grub.d/40_custom is particularly useful for adding entire custom menu entries; simply type the menu entries you want to add at the end of that file, making sure to leave at least the first two lines intact.

5.2 Writing full configuration files directly

grub.cfg is written in GRUB's built-in scripting language, which has a syntax quite similar to that of GNU Bash and other Bourne shell derivatives.

Kata-kata

A word is a sequence of characters considered as a single unit by GRUB. Words are separated by metacharacters , which are the following plus space, tab, and newline:
 { } | & $ ; < >
Quoting may be used to include metacharacters in words; see below.

Reserved kata

Reserved words have a special meaning to GRUB. The following words are recognised as reserved when unquoted and either the first word of a simple command or the third word of a for command:
 ! [[ ]] { }
     case do done elif else esac fi for function
     if in menuentry select then time until while
Not all of these reserved words have a useful purpose yet; some are reserved for future expansion.

Mengutip

Quoting is used to remove the special meaning of certain characters or words. It can be used to treat metacharacters as part of a word, to prevent reserved words from being recognised as such, and to prevent variable expansion.
There are three quoting mechanisms: the escape character, single quotes, and double quotes.
A non-quoted backslash (\) is the escape character . It preserves the literal value of the next character that follows, with the exception of newline.
Enclosing characters in single quotes preserves the literal value of each character within the quotes. A single quote may not occur between single quotes, even when preceded by a backslash.
Enclosing characters in double quotes preserves the literal value of all characters within the quotes, with the exception of ' $ ' and ' \ '. The ' $ ' character retains its special meaning within double quotes. The backslash retains its special meaning only when followed by one of the following characters: ' $ ', ' " ', ' \ ', or newline. A backslash-newline pair is treated as a line continuation (that is, it is removed from the input stream and effectively ignored 6 ). A double quote may be quoted within double quotes by preceding it with a backslash.

Variable expansion

The ' $ ' character introduces variable expansion. The variable name to be expanded may be enclosed in braces, which are optional but serve to protect the variable to be expanded from characters immediately following it which could be interpreted as part of the name.
Normal variable names begin with an alphabetic character, followed by zero or more alphanumeric characters. These names refer to entries in the GRUB environment (see Environment ).
Positional variable names consist of one or more digits. They represent parameters passed to function calls, with ' $1 ' representing the first parameter, and so on.
The special variable name ' ? ' expands to the exit status of the most recently executed command. When positional variable names are active, other special variable names ' @ ', ' * ' and ' # ' are defined and they expand to all positional parameters with necessary quoting, positional parameters without any quoting, and positional parameter count respectively.

Komentar

A word beginning with ' # ' causes that word and all remaining characters on that line to be ignored.

Sederhana perintah

A simple command is a sequence of words separated by spaces or tabs and terminated by a semicolon or a newline. The first word specifies the command to be executed. The remaining words are passed as arguments to the invoked command.
The return value of a simple command is its exit status. If the reserved word ! precedes the command, then the return value is instead the logical negation of the command's exit status.

Compound commands

A compound command is one of the following:
for name in word ... ; do list ; done
The list of words following in is expanded, generating a list of items. The variable name is set to each element of this list in turn, and list is executed each time. The return value is the exit status of the last command that executes. If the expansion of the items following in results in an empty list, no commands are executed, and the return status is 0.
if list ; then list ; [elif list ; then list ;] ... [else list ;] fi
The if list is executed. If its exit status is zero, the then list is executed. Otherwise, each elif list is executed in turn, and if its exit status is zero, the corresponding then list is executed and the command completes. Otherwise, the else list is executed, if present. The exit status is the exit status of the last command executed, or zero if no condition tested true.
while cond ; do list ; done
until cond ; do list ; done
The while command continuously executes the do list as long as the last command in cond returns an exit status of zero. The until command is identical to the while command, except that the test is negated; the do list is executed as long as the last command in cond returns a non-zero exit status. The exit status of the while and until commands is the exit status of the last do list command executed, or zero if none was executed.
function name { command ; ... }
This defines a function named name . The body of the function is the list of commands within braces, each of which must be terminated with a semicolon or a newline. This list of commands will be executed whenever name is specified as the name of a simple command. Function definitions do not affect the exit status in $? . When executed, the exit status of a function is the exit status of the last command executed in the body.
menuentry title [ --class=class ... ] [ --users=users ] [ --unrestricted ] [ --hotkey=key ] { command ; ... }
See menuentry .

Built-in Commands

Some built-in commands are also provided by GRUB script to help script writers perform actions that are otherwise not possible. For example, these include commands to jump out of a loop without fully completing it, etc.
break [ n ]
Exit from within a for , while , or until loop. If n is specified, break n levels. n must be greater than or equal to 1. If n is greater than the number of enclosing loops, all enclosing loops are exited. The return value is 0 unless n is not greater than or equal to 1.
continue [ n ]
Resume the next iteration of the enclosing for , while or until loop. If n is specified, resume at the n th enclosing loop. n must be greater than or equal to 1. If n is greater than the number of enclosing loops, the last enclosing loop (the top-level loop) is resumed. The return value is 0 unless n is not greater than or equal to 1.
return [ n ]
Causes a function to exit with the return value specified by n . If n is omitted, the return status is that of the last command executed in the function body. If used outside a function the return status is false.
shift [ n ]
The positional parameters from n +1 ... are renamed to $1 ... . Parameters represented by the numbers $# down to $# - n +1 are unset. n must be a non-negative number less than or equal to $# . If n is 0, no parameters are changed. If n is not given, it is assumed to be 1. If n is greater than $# , the positional parameters are not changed. The return status is greater than zero if n is greater than $# or less than zero; otherwise 0.

5.3 Multi-boot manual config

Currently autogenerating config files for multi-boot environments depends on os-prober and has several shortcomings. While fixing it is scheduled for the next release, meanwhile you can make use of the power of GRUB syntax and do it yourself. A possible configuration is detailed here, feel free to adjust to your needs.
First create a separate GRUB partition, big enough to hold GRUB. Some of the following entries show how to load OS installer images from this same partition, for that you obviously need to make the partition large enough to hold those images as well. Mount this partition on/mnt/boot and disable GRUB in all OSes and manually install self-compiled latest GRUB with:
grub-install --boot-directory=/mnt/boot /dev/sda
In all the OSes install GRUB tools but disable installing GRUB in bootsector, so you'll have menu.lst and grub.cfg available for use. Also disable os-prober use by setting:
GRUB_DISABLE_OS_PROBER=true
in /etc/default/grub
Then write a grub.cfg (/mnt/boot/grub/grub.cfg):
     
     menuentry "OS using grub2" {
        insmod xfs
        search --set=root --label OS1 --hint hd0,msdos8
        configfile /boot/grub/grub.cfg
      }
     
     menuentry "OS using grub2-legacy" {
         insmod ext2
        search --set=root --label OS2 --hint hd0,msdos6
        legacy_configfile /boot/grub/menu.lst
      }
     
     menuentry "Windows XP" {
        insmod ntfs
        search --set=root --label WINDOWS_XP --hint hd0,msdos1
        ntldr /ntldr
      }
     
     menuentry "Windows 7" {
        insmod ntfs
        search --set=root --label WINDOWS_7 --hint hd0,msdos2
        ntldr /bootmgr
      }
     
     menuentry "FreeBSD" {
               insmod zfs
               search --set=root --label freepool --hint hd0,msdos7
               kfreebsd /freebsd@/boot/kernel/kernel
               kfreebsd_module_elf /freebsd@/boot/kernel/opensolaris.ko
               kfreebsd_module_elf /freebsd@/boot/kernel/zfs.ko
               kfreebsd_module /freebsd@/boot/zfs/zpool.cache type=/boot/zfs/zpool.cache
               set kFreeBSD.vfs.root.mountfrom=zfs:freepool/freebsd
               set kFreeBSD.hw.psm.synaptics_support=1
      }
     
     menuentry "experimental GRUB" {
               search --set=root --label GRUB --hint hd0,msdos5
               multiboot /experimental/grub/i386-pc/core.img
      }
     
     menuentry "Fedora 16 installer" {
               search --set=root --label GRUB --hint hd0,msdos5
               linux /fedora/vmlinuz lang=en_US keymap=sg resolution=1280x800
               initrd /fedora/initrd.img
      }
     
     menuentry "Fedora rawhide installer" {
               search --set=root --label GRUB --hint hd0,msdos5
               linux /fedora/vmlinuz repo=ftp://mirror.switch.ch/mirror/fedora/linux/development/rawhide/x86_64 lang=en_US keymap=sg resolution=1280x800
               initrd /fedora/initrd.img
      }
     
     menuentry "Debian sid installer" {
               search --set=root --label GRUB --hint hd0,msdos5
               linux /debian/dists/sid/main/installer-amd64/current/images/hd-media/vmlinuz
               initrd /debian/dists/sid/main/installer-amd64/current/images/hd-media/initrd.gz
      }
     
Catatan:
  • Argument to search after –label is FS LABEL. You can also use UUIDs with –fs-uuid UUID instead of –label LABEL. You could also use direct root=hd0,msdosX but this is not recommened due to device name instability.

5.4 Embedding a configuration file into GRUB

GRUB supports embedding a configuration file directly into the core image, so that it is loaded before entering normal mode. This is useful, for example, when it is not straightforward to find the real configuration file, or when you need to debug problems with loading that file. grub-install uses this feature when it is not using BIOS disk functions or when installing to a different disk from the one containing /boot/grub , in which case it needs to use the search command (see search ) to find /boot/grub .
To embed a configuration file, use the -c option to grub-mkimage . The file is copied into the core image, so it may reside anywhere on the file system, and may be removed after running grub-mkimage .
After the embedded configuration file (if any) is executed, GRUB will load the ' normal ' module (see normal ), which will then read the real configuration file from $prefix/grub.cfg . By this point, the root variable will also have been set to the root device name. For example, prefix might be set to ' (hd0,1)/boot/grub ', and root might be set to ' hd0,1 '. Thus, in most cases, the embedded configuration file only needs to set the prefix and root variables, and then drop through to GRUB's normal processing. A typical example of this might look like this:
 search.fs_uuid 01234567-89ab-cdef-0123-456789abcdef root
     set prefix=($root)/boot/grub
(The ' search_fs_uuid ' module must be included in the core image for this example to work.)
In more complex cases, it may be useful to read other configuration files directly from the embedded configuration file. This allows such things as reading files not called grub.cfg , or reading files from a directory other than that where GRUB's loadable modules are installed. To do this, include the ' configfile ' and ' normal ' modules in the core image, and embed a configuration file that uses the configfile command to load another file. The following example of this also requires the echo , search_label , and test modules to be included in the core image:
 search.fs_label grub root
     if [ -e /boot/grub/example/test1.cfg ]; then
         set prefix=($root)/boot/grub
         configfile /boot/grub/example/test1.cfg
      lain
         if [ -e /boot/grub/example/test2.cfg ]; then
             set prefix=($root)/boot/grub
             configfile /boot/grub/example/test2.cfg
          lain
             echo "Could not find an example configuration file!"
          fi
      fi
The embedded configuration file may not contain menu entries directly, but may only read them from elsewhere using configfile .

Next: , Previous: Configuration , Up: Top

6 Theme file format

6.1 Pendahuluan

The GRUB graphical menu supports themes that can customize the layout and appearance of the GRUB boot menu. The theme is configured through a plain text file that specifies the layout of the various GUI components (including the boot menu, timeout progress bar, and text messages) as well as the appearance using colors, fonts, and images. Example is available in docs/example_theme.txt

6.2 Theme Elements

6.2.1 Colors

Colors can be specified in several ways:
  • HTML-style “#RRGGBB” or “#RGB” format, where *R*, *G*, and *B* are hexadecimal digits (eg, “#8899FF”)
  • as comma-separated decimal RGB values (eg, “128, 128, 255”)
  • with “SVG 1.0 color names” (eg, “cornflowerblue”) which must be specified in lowercase.

6.2.2 Fonts

The fonts GRUB uses “PFF2 font format” bitmap fonts. Fonts are specified with full font names. Currently there is no provision for a preference list of fonts, or deriving one font from another. Fonts are loaded with the “loadfont” command in GRUB. To see the list of loaded fonts, execute the “lsfonts” command. If there are too many fonts to fit on screen, do “set pager=1” before executing “lsfonts”.

6.2.3 Progress Bar

Gambar 6.1
Figure 6.2
Progress bars are used to display the remaining time before GRUB boots the default menu entry. To create a progress bar that will display the remaining time before automatic boot, simply create a “progress_bar” component with the id “__timeout__”. This indicates to GRUB that the progress bar should be updated as time passes, and it should be made invisible if the countdown to automatic boot is interrupted by the user.
Progress bars may optionally have text displayed on them. This text is controlled by variable “text” which contains a printf template with the only argument %d is the number of seconds remaining. Additionally special values “@TIMEOUT_NOTIFICATION_SHORT@”, “@TIMEOUT_NOTIFICATION_MIDDLE@”, “@TIMEOUT_NOTIFICATION_LONG@” are replaced with standard and translated templates.

6.2.4 Circular Progress Indicator

The circular progress indicator functions similarly to the progress bar. When given an id of “__timeout__”, GRUB updates the circular progress indicator's value to indicate the time remaining. For the circular progress indicator, there are two images used to render it: the *center* image, and the *tick* image. The center image is rendered in the center of the component, while the tick image is used to render each mark along the circumference of the indicator.

6.2.5 Labels

Text labels can be placed on the boot screen. The font, color, and horizontal alignment can be specified for labels. If a label is given the id “__timeout__”, then the “text” property for that label is also updated with a message informing the user of the number of seconds remaining until automatic boot. This is useful in case you want the text displayed somewhere else instead of directly on the progress bar.

6.2.6 Boot Menu

The boot menu where GRUB displays the menu entries from the “grub.cfg” file. It is a list of items, where each item has a title and an optional icon. The icon is selected based on the *classes* specified for the menu entry. If there is a PNG file named “myclass.png” in the “grub/themes/icons” directory, it will be displayed for items which have the class *myclass*. The boot menu can be customized in several ways, such as the font and color used for the menu entry title, and by specifying styled boxes for the menu itself and for the selected item highlight.

6.2.7 Styled Boxes

One of the most important features for customizing the layout is the use of *styled boxes*. A styled box is composed of 9 rectangular (and potentially empty) regions, which are used to seamlessly draw the styled box on screen:
Northwest (nw) North (n) Northeast (ne)
West (w) Center (c) East (e)
Southwest (sw) South (s) Southeast (se)
To support any size of box on screen, the center slice and the slices for the top, bottom, and sides are all scaled to the correct size for the component on screen, using the following rules:
  1. The edge slices (north, south, east, and west) are scaled in the direction of the edge they are adjacent to. For instance, the west slice is scaled vertically.
  2. The corner slices (northwest, northeast, southeast, and southwest) are not scaled.
  3. The center slice is scaled to fill the remaining space in the middle.
As an example of how an image might be sliced up, consider the styled box used for a terminal view.
Figure 6.3

6.2.8 Creating Styled Box Images

The Inkscape_ scalable vector graphics editor is a very useful tool for creating styled box images. One process that works well for slicing a drawing into the necessary image slices is:
  1. Create or open the drawing you'd like use.
  2. Create a new layer on the top of the layer stack. Make it visible. Select this layer as the current layer.
  3. Draw 9 rectangles on your drawing where you'd like the slices to be. Clear the fill option, and set the stroke to 1 pixel wide solid stroke. The corners of the slices must meet precisely; if it is off by a single pixel, it will probably be evident when the styled box is rendered in the GRUB menu. You should probably go to File | Document Properties | Grids and enable a grid or create a guide (click on one of the rulers next to the drawing and drag over the drawing; release the mouse button to place the guide) to help place the rectangles precisely.
  4. Right click on the center slice rectangle and choose Object Properties. Change the "Id" to “slice_c“ and click Set. Repeat this for the remaining 8 rectangles, giving them Id values of “slice_n“, “slice_ne“, “slice_e“, and so on according to the location.
  5. Save the drawing.
  6. Select all the slice rectangles. With the slice layer selected, you can simply press Ctrl+A to select all rectangles. The status bar should indicate that 9 rectangles are selected.
  7. Click the layer hide icon for the slice layer in the layer palette. The rectangles will remain selected, even though they are hidden.
  8. Choose File | Export Bitmap and check the *Batch export 9 selected objects* box. Make sure that *Hide all except selected* is unchecked. click *Export*. This will create PNG files in the same directory as the drawing, named after the slices. These can now be used for a styled box in a GRUB theme.

6.3 Theme File Manual

The theme file is a plain text file. Lines that begin with “#“ are ignored and considered comments. (Note: This may not be the case if the previous line ended where a value was expected.)
The theme file contains two types of statements:
  1. Global properties.
  2. Component construction.

6.3.1 Global Properties

6.3.2 Format

Global properties are specified with the simple format:
  • name1: value1
  • name2: "value which may contain spaces"
  • name3: #88F
In this example, name3 is assigned a color value.

6.3.3 Global Property List

title-text Specifies the text to display at the top center of the screen as a title.
title-font Defines the font used for the title message at the top of the screen.
title-color Defines the color of the title message.
message-font Defines the font used for messages, such as when GRUB is unable to automatically boot an entry.
message-color Defines the color of the message text.
message-bg-color Defines the background color of the message text area.
desktop-image Specifies the image to use as the background. It will be scaled to fit the screen size.
desktop-color Specifies the color for the background if *desktop-image* is not specified.
terminal-box Specifies the file name pattern for the styled box slices used for the command line terminal window. For example, “terminal-box: terminal_*.png” will use the images “terminal_c.png“ as the center area, “terminal_n.png“ as the north (top) edge, “terminal_nw.png“ as the northwest (upper left) corner, and so on. If the image for any slice is not found, it will simply be left empty.

6.3.4 Component Construction

Greater customizability comes is provided by components. A tree of components forms the user interface. *Containers* are components that can contain other components, and there is always a single root component which is an instance of a *canvas* container.
Components are created in the theme file by prefixing the type of component with a '+' sign:
+ label { text="GRUB" font="aqui 11" color="#8FF" }
properties of a component are specified as "name = value" (whitespace surrounding tokens is optional and is ignored) where *value* may be:
  • a single word (eg, “align = center“, “color = #FF8080“),
  • a quoted string (eg, “text = "Hello, World!"“), or
  • a tuple (eg, “preferred_size = (120, 80)“).

6.3.5 Component List

The following is a list of the components and the properties they support.
  • label A label displays a line of text. Properties:
    teks The text to display.
    fon The font to use for text display.
    warna The color of the text.
    meluruskan The horizontal alignment of the text within the component. Options are “left“, “center“, and “right“.
  • image A component that displays an image. The image is scaled to fit the component, although the preferred size defaults to the image's original size unless the “preferred_size“ property is explicitly set. Properties:
    berkas The full path to the image file to load.
  • progress_bar Displays a horizontally oriented progress bar. It can be rendered using simple solid filled rectangles, or using a pair of pixmap styled boxes. Properties:
    fg_color The foreground color for plain solid color rendering.
    bg_color The background color for plain solid color rendering.
    border_color The border color for plain solid color rendering.
    text_color The text color.
    show_text Boolean value indicating whether or not text should be displayed on the progress bar. If set to *false*, then no text will be displayed on the bar. If set to any other value, text will be displayed on the bar.
    bar_style The styled box specification for the frame of the progress bar. Example: “progress_frame_*.png“
    highlight_style The styled box specification for the highlighted region of the progress bar. This box will be used to paint just the highlighted region of the bar, and will be increased in size as the bar nears completion. Example: “progress_hl_*.png“.
    teks The text to display on the progress bar. If the progress bar's ID is set to “__timeout__“, then GRUB will updated this property with an informative message as the timeout approaches.
    nilai The progress bar current value. Normally not set manually.
    mulai The progress bar start value. Normally not set manually.
    akhir The progress bar end value. Normally not set manually.
  • circular_progress Displays a circular progress indicator. The appearance of this component is determined by two images: the *center* image and the *tick* image. The center image is generally larger and will be drawn in the center of the component. Around the circumference of a circle within the component, the tick image will be drawn a certain number of times, depending on the properties of the component. Properties:
    center_bitmap The file name of the image to draw in the center of the component.
    tick_bitmap The file name of the image to draw for the tick marks.
    num_ticks The number of ticks that make up a full circle.
    ticks_disappear Boolean value indicating whether tick marks should progressively appear, or progressively disappear as *value* approaches *end*. Specify “true“ or “false“.
    nilai The progress indicator current value. Normally not set manually.
    mulai The progress indicator start value. Normally not set manually.
    akhir The progress indicator end value. Normally not set manually.
  • boot_menu Displays the GRUB boot menu. It allows selecting items and executing them. Properties:
    item_font The font to use for the menu item titles.
    selected_item_font The font to use for the selected menu item, or “inherit“ (the default) to use “item_font“ for the selected menu item as well.
    item_color The color to use for the menu item titles.
    selected_item_color The color to use for the selected menu item, or “inherit“ (the default) to use “item_color“ for the selected menu item as well.
    icon_width The width of menu item icons. Icons are scaled to the specified size.
    icon_height The height of menu item icons.
    item_height The height of each menu item in pixels.
    item_padding The amount of space in pixels to leave on each side of the menu item contents.
    item_icon_space The space between an item's icon and the title text, in pixels.
    item_spacing The amount of space to leave between menu items, in pixels.
    menu_pixmap_style The image file pattern for the menu frame styled box. Example: “menu_*.png“ (this will use images such as “menu_c.png“, “menu_w.png“, `menu_nw.png“, etc.)
    selected_item_pixmap_style The image file pattern for the selected item highlight styled box.
    scrollbar Boolean value indicating whether the scroll bar should be drawn if the frame and thumb styled boxes are configured.
    scrollbar_frame The image file pattern for the entire scroll bar. Example: “scrollbar_*.png“
    scrollbar_thumb The image file pattern for the scroll bar thumb (the part of the scroll bar that moves as scrolling occurs). Example: “scrollbar_thumb_*.png“
    max_items_shown The maximum number of items to show on the menu. If there are more than *max_items_shown* items in the menu, the list will scroll to make all items accessible.
  • canvas Canvas is a container that allows manual placement of components within it. It does not alter the positions of its child components. It assigns all child components their preferred sizes.
  • hbox The *hbox* container lays out its children from left to right, giving each one its preferred width. The height of each child is set to the maximum of the preferred heights of all children.
  • vbox The *vbox* container lays out its children from top to bottom, giving each one its preferred height. The width of each child is set to the maximum of the preferred widths of all children.

6.3.6 Common properties

The following properties are supported by all components:
' left '
The distance from the left border of container to left border of the object in either of three formats:
x Value in pixels
p% Persentase
p%+x mixture of both
' top '
The distance from the left border of container to left border of the object in same format.
' width '
The width of object in same format.
' height '
The height of object in same format.
' id '
The identifier for the component. This can be any arbitrary string. The ID can be used by scripts to refer to various components in the GUI component tree. Currently, there is one special ID value that GRUB recognizes:
“__timeout__“ Any component with this ID will have its *text*, *start*, *end*, *value*, and *visible* properties set by GRUB when it is counting down to an automatic boot of the default menu entry.

Next: , Previous: Theme file format , Up: Top

7 Booting GRUB from the network

The following instructions only work on PC BIOS systems where the Preboot eXecution Environment (PXE) is available.
To generate a PXE boot image, run:
 grub-mkimage --format=i386-pc-pxe --output=grub.pxe --prefix='(pxe)/boot/grub' pxe pxecmd
Copy grub.pxe , /boot/grub/*.mod , and /boot/grub/*.lst to the PXE (TFTP) server, ensuring that *.mod and *.lst are accessible via the /boot/grub/ path from the TFTP server root. Set the DHCP server configuration to offer grub.pxe as the boot file (the ' filename ' option in ISC dhcpd).
You can also use the grub-mknetdir utility to generate an image and a GRUB directory tree, rather than copying files around manually.
After GRUB has started, files on the TFTP server will be accessible via the ' (pxe) ' device.
The server and gateway IP address can be controlled by changing the ' (pxe) ' device name to ' (pxe: server-ip ) ' or ' (pxe: server-ip : gateway-ip ) '. Note that this should be changed both in the prefix and in any references to the device name in the configuration file.
GRUB provides several environment variables which may be used to inspect or change the behaviour of the PXE device:
' net_pxe_ip '
The IP address of this machine. Read-only.
' net_pxe_mac '
The network interface's MAC address. Read-only.
' net_pxe_hostname '
The client host name provided by DHCP. Read-only.
' net_pxe_domain '
The client domain name provided by DHCP. Read-only.
' net_pxe_rootpath '
The path to the client's root disk provided by DHCP. Read-only.
' net_pxe_extensionspath '
The path to additional DHCP vendor extensions provided by DHCP. Read-only.
' net_pxe_boot_file '
The boot file name provided by DHCP. Read-only.
' net_pxe_dhcp_server_name '
The name of the DHCP server responsible for these boot parameters. Read-only.
' net_default_server '
The default server. Read-write, although setting this is only useful before opening a network device.

Next: , Previous: Network , Up: Top

8 Using GRUB via a serial line

This chapter describes how to use the serial terminal support in GRUB.
If you have many computers or computers with no display/keyboard, it could be very useful to control the computers through serial communications. To connect one computer with another via a serial line, you need to prepare a null-modem (cross) serial cable, and you may need to have multiport serial boards, if your computer doesn't have extra serial ports. In addition, a terminal emulator is also required, such as minicom. Refer to a manual of your operating system, for more information.
As for GRUB, the instruction to set up a serial terminal is quite simple. Berikut adalah contoh:
 grub> serial --unit=0 --speed=9600
     grub> terminal_input serial; terminal_output serial
The command serial initializes the serial unit 0 with the speed 9600bps. The serial unit 0 is usually called ' COM1 ', so, if you want to use COM2, you must specify ' --unit=1 ' instead. This command accepts many other options, so please refer to serial , for more details.
The commands terminal_input (see terminal_input ) and terminal_output (see terminal_output ) choose which type of terminal you want to use. In the case above, the terminal will be a serial terminal, but you can also pass console to the command, as ' terminal_input serial console '. In this case, a terminal in which you press any key will be selected as a GRUB terminal. In the example above, note that you need to put both commands on the same command line, as you will lose the ability to type commands on the console after the first command.
However, note that GRUB assumes that your terminal emulator is compatible with VT100 by default. This is true for most terminal emulators nowadays, but you should pass the option --dumb to the command if your terminal emulator is not VT100-compatible or implements few VT100 escape sequences. If you specify this option then GRUB provides you with an alternative menu interface, because the normal menu requires several fancy features of your terminal.

Next: , Previous: Serial terminal , Up: Top

9 Using GRUB with vendor power-on keys

Some laptop vendors provide an additional power-on button which boots another OS. GRUB supports such buttons with the ' GRUB_TIMEOUT_BUTTON ', ' GRUB_DEFAULT_BUTTON ', ' GRUB_HIDDEN_TIMEOUT_BUTTON ' and ' GRUB_BUTTON_CMOS_ADDRESS ' variables in default/grub (see Simple configuration ). ' GRUB_TIMEOUT_BUTTON ', ' GRUB_DEFAULT_BUTTON ' and ' GRUB_HIDDEN_TIMEOUT_BUTTON ' are used instead of the corresponding variables without the ' _BUTTON ' suffix when powered on using the special button. ' GRUB_BUTTON_CMOS_ADDRESS ' is vendor-specific and partially model-specific. Values known to the GRUB team are:
85:3
84:1 (unconfirmed)
To take full advantage of this function, install GRUB into the MBR (see Installing GRUB using grub-install ).
If you have a laptop which has a similar feature and not in the above list could you figure your address and contribute? To discover the address do the following:
  • boot normally
  •  sudo modprobe nvram
              sudo cat /dev/nvram | xxd > normal_button.txt
    
  • boot using vendor button
  •  sudo modprobe nvram
              sudo cat /dev/nvram | xxd > normal_vendor.txt
    
Then compare these text files and find where a bit was toggled. Eg in case of Dell XPS it was:
 byte 0x47: 20 --> 28
It's a bit number 3 as seen from following table:
0 01
1 02
2 04
3 08
4 10
5 20
6 40
7 80
0x47 is decimal 71. Linux nvram implementation cuts first 14 bytes of CMOS. So the real byte address in CMOS is 71+14=85 So complete address is 85:3

Next: , Previous: Vendor power-on keys , Up: Top

10 GRUB image files

GRUB consists of several images: a variety of bootstrap images for starting GRUB in various ways, a kernel image, and a set of modules which are combined with the kernel image to form a core image. Here is a short overview of them.
boot.img
On PC BIOS systems, this image is the first part of GRUB to start. It is written to a master boot record (MBR) or to the boot sector of a partition. Because a PC boot sector is 512 bytes, the size of this image is exactly 512 bytes. The sole function of boot.img is to read the first sector of the core image from a local disk and jump to it. Because of the size restriction, boot.img cannot understand any file system structure, so grub-setup hardcodes the location of the first sector of the core image into boot.img when installing GRUB.
diskboot.img
This image is used as the first sector of the core image when booting from a hard disk. It reads the rest of the core image into memory and starts the kernel. Since file system handling is not yet available, it encodes the location of the core image using a block list format.
cdboot.img
This image is used as the first sector of the core image when booting from a CD-ROM drive. It performs a similar function to diskboot.img .
pxeboot.img
This image is used as the start of the core image when booting from the network using PXE. See Network .
lnxboot.img
This image may be placed at the start of the core image in order to make GRUB look enough like a Linux kernel that it can be booted by LILO using an ' image= ' section.
kernel.img
This image contains GRUB's basic run-time facilities: frameworks for device and file handling, environment variables, the rescue mode command-line parser, and so on. It is rarely used directly, but is built into all core images.
core.img
This is the core image of GRUB. It is built dynamically from the kernel image and an arbitrary list of modules by the grub-mkimage program. Usually, it contains enough modules to access /boot/grub , and loads everything else (including menu handling, the ability to load target operating systems, and so on) from the file system at run-time. The modular design allows the core image to be kept small, since the areas of disk where it must be installed are often as small as 32KB. See BIOS installation , for details on where the core image can be installed on PC systems.
*.mod
Everything else in GRUB resides in dynamically loadable modules. These are often loaded automatically, or built into the core image if they are essential, but may also be loaded manually using the insmod command (see insmod ).

For GRUB Legacy users

GRUB 2 has a different design from GRUB Legacy, and so correspondences with the images it used cannot be exact. Nevertheless, GRUB Legacy users often ask questions in the terms they are familiar with, and so here is a brief guide to how GRUB 2's images relate to that.
stage1
Stage 1 from GRUB Legacy was very similar to boot.img in GRUB 2, and they serve the same function.
*_stage1_5
In GRUB Legacy, Stage 1.5's function was to include enough filesystem code to allow the much larger Stage 2 to be read from an ordinary filesystem. In this respect, its function was similar to core.img in GRUB 2. However, core.img is much more capable than Stage 1.5 was; since it offers a rescue shell, it is sometimes possible to recover manually in the event that it is unable to load any other modules, for example if partition numbers have changed. core.img is built in a more flexible way, allowing GRUB 2 to support reading modules from advanced disk types such as LVM and RAID. GRUB Legacy could run with only Stage 1 and Stage 2 in some limited configurations, while GRUB 2 requires core.img and cannot work without it.
stage2
GRUB 2 has no single Stage 2 image. Instead, it loads modules from /boot/grub at run-time.
stage2_eltorito
In GRUB 2, images for booting from CD-ROM drives are now constructed using cdboot.img and core.img , making sure that the core image contains the ' iso9660 ' module. It is usually best to use the grub-mkrescue program for this.
nbgrub
There is as yet no equivalent for nbgrub in GRUB 2; it was used by Etherboot and some other network boot loaders.
pxegrub
In GRUB 2, images for PXE network booting are now constructed using pxeboot.img and core.img , making sure that the core image contains the ' pxe ' and ' pxecmd ' modules. See Network .

Next: , Previous: Images , Up: Top

11 Filesystem syntax and semantics

GRUB uses a special syntax for specifying disk drives which can be accessed by BIOS. Because of BIOS limitations, GRUB cannot distinguish between IDE, ESDI, SCSI, or others. You must know yourself which BIOS device is equivalent to which OS device. Normally, that will be clear if you see the files in a device or use the command search (see search ).

11.1 How to specify devices

The device syntax is like this:
 ( device [, partmap-name1 part-num1 [, partmap-name2 part-num2 [,...]]])
' [] ' means the parameter is optional. device depends on the disk driver in use. BIOS and EFI disks use either ' fd ' or ' hd ' followed by a digit, like ' fd0 ', or ' cd '. AHCI, PATA (ata), crypto, USB use the name of driver followed by a number. Memdisk and host are limited to one disk and so it's refered just by driver name. RAID (md), ofdisk (ieee1275 and nand), LVM (lv), LDM and arcdisk (arc) use intrinsic name of disk prefixed by driver name. Additionally just “nand” refers to the disk aliased as “nand”. Conflicts are solved by suffixing a number if necessarry. Commas need to be escaped. Loopback uses whatever name specified to loopback command. Hostdisk uses names specified in device.map as long as it's of the form [fhc]d[0-9]* or hostdisk/. For crypto and RAID (md) additionally you can use the syntax uuid/.
 (fd0)
     (hd0)
      (Cd)
     (ahci0)
     (ata0)
     (crypto0)
     (usb0)
     (cryptouuid/123456789abcdef0123456789abcdef0)
     (mduuid/123456789abcdef0123456789abcdef0)
     (lv/system-root)
     (md/myraid)
     (md/0)
     (ieee1275/disk2)
     (ieee1275//pci@1f\,0/ide@d/disk@2)
     (nand)
     (memdisk)
     (host)
     (myloop)
     (hostdisk//dev/sda)
part-num represents the partition number of device , starting from one. partname is optional but is recommended since disk may have several top-level partmaps. Specifying third and later component you can access to subpartitions.
The syntax ' (hd0) ' represents using the entire disk (or the MBR when installing GRUB), while the syntax ' (hd0,1) ' represents using the first partition of the disk (or the boot sector of the partition when installing GRUB).
 (hd0,msdos1)
     (hd0,msdos1,msdos5)
     (hd0,msdos1,bsd3)
     (hd0,netbsd1)
     (hd0,gpt1)
     (hd0,1,3)
If you enabled the network support, the special drives ' (tftp) ', ' (http) ' and so on ars also available. Before using the network drive, you must initialize the network. See Network , for more information.
If you boot GRUB from a CD-ROM, ' (cd) ' is available. See Making a GRUB bootable CD-ROM , for details.

Next: , Previous: Device syntax , Up: Filesystem

11.2 How to specify files

There are two ways to specify files, by absolute file name and by block list .
An absolute file name resembles a Unix absolute file name, using ' / ' for the directory separator (not ' \ ' as in DOS). One example is ' (hd0,1)/boot/grub/grub.cfg '. This means the file /boot/grub/grub.cfg in the first partition of the first hard disk. If you omit the device name in an absolute file name, GRUB uses GRUB's root device implicitly. So if you set the root device to, say, ' (hd1,1) ' by the command ' set root=(hd1,1) ' (see set ), then /boot/kernel is the same as (hd1,1)/boot/kernel .

Previous: File name syntax , Up: Filesystem

11.3 How to specify block lists

A block list is used for specifying a file that doesn't appear in the filesystem, like a chainloader. The syntax is [ offset ]+ length [,[ offset ]+ length ]... . Berikut adalah contoh:
0+100,200+1,300+300 
This represents that GRUB should read blocks 0 through 99, block 200, and blocks 300 through 599. If you omit an offset, then GRUB assumes the offset is zero.
Like the file name syntax (see File name syntax ), if a blocklist does not contain a device name, then GRUB uses GRUB's root device . So (hd0,2)+1 is the same as +1 when the root device is ' (hd0,2) '.

Next: , Previous: Filesystem , Up: Top

12 GRUB's user interface

GRUB has both a simple menu interface for choosing preset entries from a configuration file, and a highly flexible command-line for performing any desired combination of boot commands.
GRUB looks for its configuration file as soon as it is loaded. If one is found, then the full menu interface is activated using whatever entries were found in the file. If you choose the command-line menu option, or if the configuration file was not found, then GRUB drops to the command-line interface.

12.1 The flexible command-line interface

The command-line interface provides a prompt and after it an editable text area much like a command-line in Unix or DOS. Each command is immediately executed after it is entered 7 . The commands (see Command-line and menu entry commands ) are a subset of those available in the configuration file, used with exactly the same syntax.
Cursor movement and editing of the text on the line can be done via a subset of the functions available in the Bash shell:
Move forward one character.
Mundur satu karakter.
Move to the start of the line.
Move the the end of the line.
Delete the character underneath the cursor.
Delete the character to the left of the cursor.
Kill the text from the current cursor position to the end of the line.
Kill backward from the cursor to the beginning of the line.
Yank the killed text back into the buffer at the cursor.
Move up through the history list.
Move down through the history list.
When typing commands interactively, if the cursor is within or before the first word in the command-line, pressing the key (or ) will display a listing of the available commands, and if the cursor is after the first word, the will provide a completion listing of disks, partitions, and file names depending on the context. Note that to obtain a list of drives, one must open a parenthesis, as root ( .
Note that you cannot use the completion functionality in the TFTP filesystem. This is because TFTP doesn't support file name listing for the security.

12.2 The simple menu interface

The menu interface is quite easy to use. Its commands are both reasonably intuitive and described on screen.
Basically, the menu interface provides a list of boot entries to the user to choose from. Use the arrow keys to select the entry of choice, then press to run it. An optional timeout is available to boot the default entry (the first one if not set), which is aborted by pressing any key.
Commands are available to enter a bare command-line by pressing (which operates exactly like the non-config-file version of GRUB, but allows one to return to the menu if desired by pressing ) or to edit any of the boot entries by pressing .
If you protect the menu interface with a password (see Security ), all you can do is choose an entry by pressing , or press to enter the password.

Previous: Menu interface , Up: Interface

12.3 Editing a menu entry

The menu entry editor looks much like the main menu interface, but the lines in the menu are individual commands in the selected entry instead of entry names.
If an is pressed in the editor, it aborts all the changes made to the configuration entry and returns to the main menu interface.
Each line in the menu entry can be edited freely, and you can add new lines by pressing at the end of a line. To boot the edited entry, press .
Although GRUB unfortunately does not support undo , you can do almost the same thing by just returning to the main menu using .

Next: , Previous: Interface , Up: Top

13 GRUB environment variables

GRUB supports environment variables which are rather like those offered by all Unix-like systems. Environment variables have a name, which is unique and is usually a short identifier, and a value, which is an arbitrary string of characters. They may be set (see set ), unset (see unset ), or looked up (see Shell-like scripting ) by name.
A number of environment variables have special meanings to various parts of GRUB. Others may be used freely in GRUB configuration files.

13.1 Special environment variables

These variables have special meaning to GRUB.

13.1.1 biosnum

When chain-loading another boot loader (see Chain-loading ), GRUB may need to know what BIOS drive number corresponds to the root device (see root ) so that it can set up registers properly. If the biosnum variable is set, it overrides GRUB's own means of guessing this.
For an alternative approach which also changes BIOS drive mappings for the chain-loaded system, see drivemap .

13.1.2 chosen

When executing a menu entry, GRUB sets the chosen variable to the title of the entry being executed.
If the menu entry is in one or more submenus, then chosen is set to the titles of each of the submenus starting from the top level followed by the title of the menu entry itself, separated by ' > '.

13.1.3 color_highlight

This variable contains the “highlight” foreground and background terminal colors, separated by a slash (' / '). Setting this variable changes those colors. For the available color names, see color_normal .
The default is ' black/white '.

13.1.4 color_normal

This variable contains the “normal” foreground and background terminal colors, separated by a slash (' / '). Setting this variable changes those colors. Each color must be a name from the following list:
  • hitam
  • biru
  • hijau
  • cyan
  • merah
  • magenta
  • coklat
  • light-gray
  • dark-gray
  • light-blue
  • light-green
  • light-cyan
  • light-red
  • light-magenta
  • kuning
  • putih
The default is ' white/black '.

13.1.5 debug

This variable may be set to enable debugging output from various components of GRUB. The value is a list of debug facility names separated by whitespace or ' , ', or ' all ' to enable all available debugging output.

Next: , Previous: debug , Up: Special environment variables

13.1.6 default

If this variable is set, it identifies a menu entry that should be selected by default, possibly after a timeout (see timeout ). The entry may be identified by number or by title.
If the entry is in a submenu, then it must be identified using the titles of each of the submenus starting from the top level followed by the number or title of the menu entry itself, separated by ' > '. For example, take the following menu structure:
 Submenu 1
       Menu Entry 1
       Menu Entry 2
      Submenu 2
        Submenu 3
         Menu Entry 3
         Menu Entry 4
       Menu Entry 5
“Menu Entry 3” would then be identified as ' Submenu 2>Submenu 3>Menu Entry 3 '.
This variable is often set by ' GRUB_DEFAULT ' (see Simple configuration ), grub-set-default , or grub-reboot .

13.1.7 fallback

If this variable is set, it identifies a menu entry that should be selected if the default menu entry fails to boot. Entries are identified in the same way as for ' default ' (see default ).

13.1.8 gfxmode

If this variable is set, it sets the resolution used on the ' gfxterm ' graphical terminal. Note that you can only use modes which your graphics card supports via VESA BIOS Extensions (VBE), so for example native LCD panel resolutions may not be available. The default is ' auto ', which selects a platform-specific default that should look reasonable.
The resolution may be specified as a sequence of one or more modes, separated by commas (' , ') or semicolons (' ; '); each will be tried in turn until one is found. Each mode should be either ' auto ', ' width x height ', or ' width x height x depth '.

13.1.9 gfxpayload

If this variable is set, it controls the video mode in which the Linux kernel starts up, replacing the ' vga= ' boot option (see linux ). It may be set to ' text ' to force the Linux kernel to boot in normal text mode, ' keep ' to preserve the graphics mode set using ' gfxmode ', or any of the permitted values for ' gfxmode ' to set a particular graphics mode (see gfxmode ).
Depending on your kernel, your distribution, your graphics card, and the phase of the moon, note that using this option may cause GNU/Linux to suffer from various display problems, particularly during the early part of the boot sequence. If you have problems, set this variable to ' text ' and GRUB will tell Linux to boot in normal text mode.
The default is platform-specific. On platforms with a native text mode (such as PC BIOS platforms), the default is ' text '. Otherwise the default may be ' auto ' or a specific video mode.
This variable is often set by ' GRUB_GFXPAYLOAD_LINUX ' (see Simple configuration ).

13.1.10 gfxterm_font

If this variable is set, it names a font to use for text on the ' gfxterm ' graphical terminal. Otherwise, ' gfxterm ' may use any available font.

13.1.11 icondir

If this variable is set, it names a directory in which the GRUB graphical menu should look for icons after looking in the theme's ' icons ' directory. See Theme file format .

13.1.12 lang

If this variable is set, it names the language code that the gettext command (see gettext ) uses to translate strings. For example, French would be named as ' fr ', and Simplified Chinese as ' zh_CN '.
grub-mkconfig (see Simple configuration ) will try to set a reasonable default for this variable based on the system locale.

13.1.13 locale_dir

If this variable is set, it names the directory where translation files may be found (see gettext ), usually /boot/grub/locale . Otherwise, internationalization is disabled.
grub-mkconfig (see Simple configuration ) will set a reasonable default for this variable if internationalization is needed and any translation files are available.

13.1.14 menu_color_highlight

This variable contains the foreground and background colors to be used for the highlighted menu entry, separated by a slash (' / '). Setting this variable changes those colors. For the available color names, see color_normal .
The default is the value of ' color_highlight ' (see color_highlight ).

13.1.15 menu_color_normal

This variable contains the foreground and background colors to be used for non-highlighted menu entries, separated by a slash (' / '). Setting this variable changes those colors. For the available color names, see color_normal .
The default is the value of ' color_normal ' (see color_normal ).

13.1.16 net_pxe_boot_file

See Network .

13.1.17 net_pxe_dhcp_server_name

See Network .

13.1.18 net_pxe_domain

See Network .

13.1.19 net_pxe_extensionspath

See Network .

13.1.20 net_pxe_hostname

See Network .

13.1.21 net_pxe_ip

See Network .

13.1.22 net_pxe_mac

See Network .

13.1.23 net_pxe_rootpath

See Network .

13.1.24 pager

If set to ' 1 ', pause output after each screenful and wait for keyboard input. The default is not to pause output.

13.1.25 prefix

The location of the ' /boot/grub ' directory as an absolute file name (see File name syntax ). This is normally set by GRUB at startup based on information provided by grub-install . GRUB modules are dynamically loaded from this directory, so it must be set correctly in order for many parts of GRUB to work.

13.1.26 pxe_blksize

See Network .

13.1.27 pxe_default_gateway

See Network .

13.1.28 pxe_default_server

See Network .

13.1.29 root

The root device name (see Device syntax ). Any file names that do not specify an explicit device name are read from this device. The default is normally set by GRUB at startup based on the value of ' prefix ' (see prefix ).
For example, if GRUB was installed to the first partition of the first hard disk, then ' prefix ' might be set to ' (hd0,msdos1)/boot/grub ' and ' root ' to ' hd0,msdos1 '.

Next: , Previous: root , Up: Special environment variables

13.1.30 superusers

This variable may be set to a list of superuser names to enable authentication support. See Security .

13.1.31 theme

This variable may be set to a directory containing a GRUB graphical menu theme. See Theme file format .
This variable is often set by ' GRUB_THEME ' (see Simple configuration ).

13.1.32 timeout

If this variable is set, it specifies the time in seconds to wait for keyboard input before booting the default menu entry. A timeout of ' 0 ' means to boot the default entry immediately without displaying the menu; a timeout of ' -1 ' (or unset) means to wait indefinitely.
This variable is often set by ' GRUB_TIMEOUT ' or ' GRUB_HIDDEN_TIMEOUT ' (see Simple configuration ).

13.2 The GRUB environment block

It is often useful to be able to remember a small amount of information from one boot to the next. For example, you might want to set the default menu entry based on what was selected the last time. GRUB deliberately does not implement support for writing files in order to minimise the possibility of the boot loader being responsible for file system corruption, so a GRUB configuration file cannot just create a file in the ordinary way. However, GRUB provides an “environment block” which can be used to save a small amount of state.
The environment block is a preallocated 1024-byte file, which normally lives in /boot/grub/grubenv (although you should not assume this). At boot time, the load_env command (see load_env ) loads environment variables from it, and the save_env (see save_env ) command saves environment variables to it. From a running system, the grub-editenv utility can be used to edit the environment block.
For safety reasons, this storage is only available when installed on a plain disk (no LVM or RAID), using a non-checksumming filesystem (no ZFS), and using BIOS or EFI functions (no ATA, USB or IEEE1275).
grub-mkconfig uses this facility to implement ' GRUB_SAVEDEFAULT ' (see Simple configuration ).

Next: , Previous: Environment , Up: Top

14 The list of available commands

In this chapter, we list all commands that are available in GRUB.
Commands belong to different groups. A few can only be used in the global section of the configuration file (or “menu”); most of them can be entered on the command-line and can be used either anywhere in the menu or specifically in the menu entries.
In rescue mode, only the insmod (see insmod ), ls (see ls ), set (see set ), and unset (see unset ) commands are normally available. If you end up in rescue mode and do not know what to do, then see GRUB only offers a rescue shell .

14.1 The list of commands for the menu only

The semantics used in parsing the configuration file are the following:
  • The files must be in plain-text format.
  • ' # ' at the beginning of a line in a configuration file means it is only a comment.
  • Options are separated by spaces.
  • All numbers can be either decimal or hexadecimal. A hexadecimal number must be preceded by ' 0x ', and is case-insensitive.
These commands can only be used in the menu:

14.1.1 menuentry

— Command: menuentry title [ --class=class ... ] [ --users=users ] [ --unrestricted ] [ --hotkey=key ] { command; ... }
This defines a GRUB menu entry named title . When this entry is selected from the menu, GRUB will set the chosen environment variable to title , execute the list of commands given within braces, and if the last command in the list returned successfully and a kernel was loaded it will execute the boot command.
The --class option may be used any number of times to group menu entries into classes. Menu themes may display different classes using different styles.
The --users option grants specific users access to specific menu entries. See Security .
The --unrestricted option grants all users access to specific menu entries. See Security .
The --hotkey option associates a hotkey with a menu entry. key may be a single letter, or one of the aliases ' backspace ', ' tab ', or ' delete '.

14.1.2 submenu

— Command: submenu title [ --class=class ... ] [ --users=users ] [ --unrestricted ] [ --hotkey=key ] { menu entries ... }
This defines a submenu. An entry called title will be added to the menu; when that entry is selected, a new menu will be displayed showing all the entries within this submenu.
All options are the same as in the menuentry command (see menuentry ).

14.2 The list of general commands

Commands usable anywhere in the menu and in the command-line.

14.2.1 serial

— Command: serial [ --unit=unit ] [ --port=port ] [ --speed=speed ] [ --word=word ] [ --parity=parity ] [ --stop=stop ]
Initialize a serial device. unit is a number in the range 0-3 specifying which serial port to use; default is 0, which corresponds to the port often called COM1. port is the I/O port where the UART is to be found; if specified it takes precedence over unit . speed is the transmission speed; default is 9600. word and stop are the number of data bits and stop bits. Data bits must be in the range 5-8 and stop bits must be 1 or 2. Default is 8 data bits and one stop bit. parity is one of ' no ', ' odd ', ' even ' and defaults to ' no '.
The serial port is not used as a communication channel unless the terminal_input or terminal_output command is used (see terminal_input , see terminal_output ).
See also Serial terminal .

Next: , Previous: serial , Up: General commands

14.2.2 terminal_input

— Command: terminal_input [ --append | --remove ] [ terminal1 ] [ terminal2 ] ...
List or select an input terminal.
With no arguments, list the active and available input terminals.
With --append , add the named terminals to the list of active input terminals; any of these may be used to provide input to GRUB.
With --remove , remove the named terminals from the active list.
With no options but a list of terminal names, make only the listed terminal names active.

Next: , Previous: terminal_input , Up: General commands

14.2.3 terminal_output

— Command: terminal_output [ --append | --remove ] [ terminal1 ] [ terminal2 ] ...
List or select an output terminal.
With no arguments, list the active and available output terminals.
With --append , add the named terminals to the list of active output terminals; all of these will receive output from GRUB.
With --remove , remove the named terminals from the active list.
With no options but a list of terminal names, make only the listed terminal names active.

14.2.4 terminfo

— Command: terminfo [ -a|-u|-v ] [ term ]
Define the capabilities of your terminal by giving the name of an entry in the terminfo database, which should correspond roughly to a ' TERM ' environment variable in Unix.
The currently available terminal types are ' vt100 ', ' vt100-color ', ' ieee1275 ', and ' dumb '. If you need other terminal types, please contact us to discuss the best way to include support for these in GRUB.
The -a ( --ascii ), -u ( --utf8 ), and -v ( --visual-utf8 ) options control how non-ASCII text is displayed. -a specifies an ASCII-only terminal; -u specifies logically-ordered UTF-8; and -v specifies "visually-ordered UTF-8" (in other words, arranged such that a terminal emulator without bidirectional text support will display right-to-left text in the proper order; this is not really proper UTF-8, but a workaround).
If no option or terminal type is specified, the current terminal type is printed.

Previous: General commands , Up: Commands

14.3 The list of command-line and menu entry commands

These commands are usable in the command-line and in menu entries. If you forget a command, you can run the command help (see help ).

14.3.1 acpi

— Command: acpi [ -1 | -2 ] [ --exclude=table1,... | --load-only=table1,... ] [ --oemid=id ] [ --oemtable=table ] [ --oemtablerev=rev ] [ --oemtablecreator=creator ] [ --oemtablecreatorrev=rev ] [ --no-ebda ] filename ...
Modern BIOS systems normally implement the Advanced Configuration and Power Interface (ACPI), and define various tables that describe the interface between an ACPI-compliant operating system and the firmware. In some cases, the tables provided by default only work well with certain operating systems, and it may be necessary to replace some of them.
Normally, this command will replace the Root System Description Pointer (RSDP) in the Extended BIOS Data Area to point to the new tables. If the --no-ebda option is used, the new tables will be known only to GRUB, but may be used by GRUB's EFI emulation.

14.3.2 badram

— Command: badram addr,mask [ ,addr,mask... ]
Filter out bad RAM.
This command notifies the memory manager that specified regions of RAM ought to be filtered out (usually, because they're damaged). This remains in effect after a payload kernel has been loaded by GRUB, as long as the loaded kernel obtains its memory map from GRUB. Kernels that support this include Linux, GNU Mach, the kernel of FreeBSD and Multiboot kernels in general.
Syntax is the same as provided by the Memtest86+ utility : a list of address/mask pairs. Given a page-aligned address and a base address / mask pair, if all the bits of the page-aligned address that are enabled by the mask match with the base address, it means this page is to be filtered. This syntax makes it easy to represent patterns that are often result of memory damage, due to physical distribution of memory cells.

14.3.3 blocklist

— Command: blocklist file
Print a block list (see Block list syntax ) for file .

14.3.4 boot

— Command: boot
Boot the OS or chain-loader which has been loaded. Only necessary if running the fully interactive command-line (it is implicit at the end of a menu entry).

14.3.5 cat

— Command: cat [ --dos ] file
Display the contents of the file file . This command may be useful to remind you of your OS's root partition:
 grub> cat /etc/fstab
If the --dos option is used, then carriage return / new line pairs will be displayed as a simple new line. Otherwise, the carriage return will be displayed as a control character (' ') to make it easier to see when boot problems are caused by a file formatted using DOS-style line endings.

Next: , Previous: cat , Up: Command-line and menu entry commands

14.3.6 chainloader

— Command: chainloader [ --force ] file
Load file as a chain-loader. Like any other file loaded by the filesystem code, it can use the blocklist notation (see Block list syntax ) to grab the first sector of the current partition with ' +1 '. If you specify the option --force , then load file forcibly, whether it has a correct signature or not. This is required when you want to load a defective boot loader, such as SCO UnixWare 7.1.

14.3.7 cmp

— Command: cmp file1 file2
Compare the file file1 with the file file2 . If they differ in size, print the sizes like this:
 Differ in size: 0x1234 [foo], 0x4321 [bar]
If the sizes are equal but the bytes at an offset differ, then print the bytes like this:
 Differ at the offset 777: 0xbe [foo], 0xef [bar]
If they are completely identical, nothing will be printed.

14.3.8 configfile

— Command: configfile file
Load file as a configuration file. If file defines any menu entries, then show a menu containing them immediately.

14.3.9 cpuid

— Command: cpuid [ -l ]
Check for CPU features. This command is only available on x86 systems.
With the -l option, return true if the CPU supports long mode (64-bit).
If invoked without options, this command currently behaves as if it had been invoked with -l . This may change in the future.

14.3.10 crc

— Command: crc file
Display the CRC32 checksum of file .

14.3.11 date

— Command: date [[ year- ] month-day ] [ hour:minute [ :second ]]
With no arguments, print the current date and time.
Otherwise, take the current date and time, change any elements specified as arguments, and set the result as the new date and time. For example, `date 01-01' will set the current month and day to January 1, but leave the year, hour, minute, and second unchanged.

14.3.12 drivemap

— Command: drivemap -l | -r | [ -s ] from_drive to_drive
Without options, map the drive from_drive to the drive to_drive . This is necessary when you chain-load some operating systems, such as DOS, if such an OS resides at a non-first drive. For convenience, any partition suffix on the drive is ignored, so you can safely use ${root} as a drive specification.
With the -s option, perform the reverse mapping as well, swapping the two drives.
With the -l option, list the current mappings.
With the -r option, reset all mappings to the default values.
Sebagai contoh:
 drivemap -s (hd0) (hd1)

14.3.13 echo

— Command: echo [ -n ] [ -e ] string ...
Display the requested text and, unless the -n option is used, a trailing new line. If there is more than one string, they are separated by spaces in the output. As usual in GRUB commands, variables may be substituted using ' ${var} '.
The -e option enables interpretation of backslash escapes. The following sequences are recognised:
\\
backslash
\a
alert (BEL)
\c
suppress trailing new line
\f
membentuk pakan
\n
baris baru
\r
carriage return
\t
horisontal tab
\v
vertikal tab
When interpreting backslash escapes, backslash followed by any other character will print that character.

14.3.14 export

— Command: export envvar
Export the environment variable envvar . Exported variables are visible to subsidiary configuration files loaded using configfile .

14.3.15 false

— Command: false
Do nothing, unsuccessfully. This is mainly useful in control constructs such as if and while (see Shell-like scripting ).

14.3.16 gettext

— Command: gettext string
Translate string into the current language.
The current language code is stored in the ' lang ' variable in GRUB's environment (see lang ). Translation files in MO format are read from ' locale_dir ' (see locale_dir ), usually /boot/grub/locale .

14.3.17 gptsync

— Command: gptsync device [ partition [ +/- [ type ]]] ...
Disks using the GUID Partition Table (GPT) also have a legacy Master Boot Record (MBR) partition table for compatibility with the BIOS and with older operating systems. The legacy MBR can only represent a limited subset of GPT partition entries.
This command populates the legacy MBR with the specified partition entries on device . Up to three partitions may be used.
type is an MBR partition type code; prefix with ' 0x ' if you want to enter this in hexadecimal. The separator between partition and type may be ' + ' to make the partition active, or ' - ' to make it inactive; only one partition may be active. If both the separator and type are omitted, then the partition will be inactive.

14.3.18 halt

— Command: halt --no-apm
The command halts the computer. If the --no-apm option is specified, no APM BIOS call is performed. Otherwise, the computer is shut down using APM.

14.3.19 help

— Command: help [ pattern ... ]
Menampilkan informasi yang berguna tentang perintah builtin. If you do not specify pattern , this command shows short descriptions of all available commands.
If you specify any patterns , it displays longer information about each of the commands whose names begin with those patterns .

14.3.20 initrd

— Command: initrd file
Load an initial ramdisk for a Linux kernel image, and set the appropriate parameters in the Linux setup area in memory. This may only be used after the linux command (see linux ) has been run. See also GNU/Linux .

14.3.21 initrd16

— Command: initrd16 file
Load an initial ramdisk for a Linux kernel image to be booted in 16-bit mode, and set the appropriate parameters in the Linux setup area in memory. This may only be used after the linux16 command (see linux16 ) has been run. See also GNU/Linux .
This command is only available on x86 systems.

14.3.22 insmod

— Command: insmod module
Insert the dynamic GRUB module called module .

14.3.23 keystatus

— Command: keystatus [ --shift ] [ --ctrl ] [ --alt ]
Return true if the Shift, Control, or Alt modifier keys are held down, as requested by options. This is useful in scripting, to allow some user control over behaviour without having to wait for a keypress.
Checking key modifier status is only supported on some platforms. If invoked without any options, the keystatus command returns true if and only if checking key modifier status is supported.

14.3.24 linux

— Command: linux file ...
Load a Linux kernel image from file . The rest of the line is passed verbatim as the kernel command-line . Any initrd must be reloaded after using this command (see initrd ).
On x86 systems, the kernel will be booted using the 32-bit boot protocol. Note that this means that the ' vga= ' boot option will not work; if you want to set a special video mode, you will need to use GRUB commands such as ' set gfxpayload=1024x768 ' or ' set gfxpayload=keep ' (to keep the same mode as used in GRUB) instead. GRUB can automatically detect some uses of ' vga= ' and translate them to appropriate settings of ' gfxpayload '. The linux16 command (see linux16 ) avoids this restriction.

14.3.25 linux16

— Command: linux16 file ...
Load a Linux kernel image from file in 16-bit mode. The rest of the line is passed verbatim as the kernel command-line . Any initrd must be reloaded after using this command (see initrd16 ).
The kernel will be booted using the traditional 16-bit boot protocol. As well as bypassing problems with ' vga= ' described in linux , this permits booting some other programs that implement the Linux boot protocol for the sake of convenience.
This command is only available on x86 systems.

14.3.26 list_env

— Command: list_env [ -f file ]
List all variables in the environment block file. See Environment block .
The -f option overrides the default location of the environment block.

14.3.27 load_env

— Command: load_env [ -f file ]
Load all variables from the environment block file into the environment. See Environment block .
The -f option overrides the default location of the environment block.

14.3.28 loopback

— Command: loopback [ -d ] device file
Make the device named device correspond to the contents of the filesystem image in file . Sebagai contoh:
 loopback loop0 /path/to/image
          ls (loop0)/
With the -d option, delete a device previously created using this command.

14.3.29 ls

— Command: ls [ arg ... ]
List devices or files.
With no arguments, print all devices known to GRUB.
If the argument is a device name enclosed in parentheses (see Device syntax ), then list all files at the root directory of that device.
If the argument is a directory given as an absolute file name (see File name syntax ), then list the contents of that directory.

14.3.30 normal

— Command: normal [ file ]
Enter normal mode and display the GRUB menu.
In normal mode, commands, filesystem modules, and cryptography modules are automatically loaded, and the full GRUB script parser is available. Other modules may be explicitly loaded using insmod (see insmod ).
If a file is given, then commands will be read from that file. Otherwise, they will be read from $prefix/grub.cfg if it exists.
normal may be called from within normal mode, creating a nested environment. It is more usual to use configfile (see configfile ) for this.

14.3.31 normal_exit

— Command: normal_exit
Exit normal mode (see normal ). If this instance of normal mode was not nested within another one, then return to rescue mode.

14.3.32 parttool

— Command: parttool partition commands
Make various modifications to partition table entries.
Each command is either a boolean option, in which case it must be followed with ' + ' or ' - ' (with no intervening space) to enable or disable that option, or else it takes a value in the form ' command = value '.
Currently, parttool is only useful on DOS partition tables (also known as Master Boot Record, or MBR). On these partition tables, the following commands are available:
' boot ' (boolean)
When enabled, this makes the selected partition be the active (bootable) partition on its disk, clearing the active flag on all other partitions. This command is limited to primary partitions.
' type ' (value)
Change the type of an existing partition. The value must be a number in the range 0-0xFF (prefix with ' 0x ' to enter it in hexadecimal).
' hidden ' (boolean)
When enabled, this hides the selected partition by setting the hidden bit in its partition type code; when disabled, unhides the selected partition by clearing this bit. This is useful only when booting DOS or Wwindows and multiple primary FAT partitions exist in one disk. See also DOS/Windows .

14.3.33 password

— Command: password user clear-password
Define a user named user with password clear-password . See Security .

14.3.34 password_pbkdf2

— Command: password_pbkdf2 user hashed-password
Define a user named user with password hash hashed-password . Use grub-mkpasswd-pbkdf2 (see Invoking grub-mkpasswd-pbkdf2 ) to generate password hashes. See Security .

14.3.35 play

— Command: play file | tempo [ pitch1 duration1 ] [ pitch2 duration2 ] ...
Plays a tune
If the argument is a file name (see File name syntax ), play the tune recorded in it. The file format is first the tempo as an unsigned 32bit little-endian number, then pairs of unsigned 16bit little-endian numbers for pitch and duration pairs.
If the arguments are a series of numbers, play the inline tune.
The tempo is the base for all note durations. 60 gives a 1-second base, 120 gives a half-second base, etc. Pitches are Hz. Set pitch to 0 to produce a rest.

14.3.36 pxe_unload

— Command: pxe_unload
Unload the PXE environment (see Network ).
This command is only available on PC BIOS systems.

14.3.37 read

— Command: read [ var ]
Read a line of input from the user. If an environment variable var is given, set that environment variable to the line of input that was read, with no terminating newline.

14.3.38 reboot

— Command: reboot
Reboot komputer.

14.3.39 save_env

— Command: save_env [ -f file ] var ...
Save the named variables from the environment to the environment block file. See Environment block .
The -f option overrides the default location of the environment block.

14.3.40 search

— Command: search [ --file | --label | --fs-uuid ] [ --set [ var ]] [ --no-floppy ] name
Search devices by file ( -f , --file ), filesystem label ( -l , --label ), or filesystem UUID ( -u , --fs-uuid ).
If the --set option is used, the first device found is set as the value of environment variable var . The default variable is ' root '.
The --no-floppy option prevents searching floppy devices, which can be slow.
The ' search.file ', ' search.fs_label ', and ' search.fs_uuid ' commands are aliases for ' search --file ', ' search --label ', and ' search --fs-uuid ' respectively.

14.3.41 sendkey

-
Insert keystrokes into the keyboard buffer when booting. Sometimes an operating system or chainloaded boot loader requires particular keys to be pressed: for example, one might need to press a particular key to enter "safe mode", or when chainloading another boot loader one might send keystrokes to it to navigate its menu.
You may provide up to 16 keystrokes (the length of the BIOS keyboard buffer). Keystroke names may be upper-case or lower-case letters, digits, or taken from the following table:
Nama Kunci
melarikan diri Melarikan diri
exclam !
di @
numbersign #
dolar $
persen %
tanda sisipan ^
ampersand &
asterisk *
parenleft (
parenright )
minus -
underscore _
sama =
plus +
backspace Backspace
tab Tab
bracketleft [
braceleft {
bracketright ]
braceright }
masuk Masuk
mengendalikan press and release Control
titik koma ;
usus besar :
mengutip '
doublequote "
backquote `
tilde ~
bergeser press and release left Shift
backslash \
bar |
comma ,
kurang <
periode .
lebih besar >
memotong /
pertanyaan ?
rshift press and release right Shift
alt press and release Alt
ruang pengatur jarak
CapsLock Caps Lock
F1 F1
F2 F2
F3 F3
F4 F4
F5 F5
F6 F6
F7 F7
F8 F8
F9 F9
F10 F10
F11 F11
F12 F12
num1 1 (numeric keypad)
num2 2 (numeric keypad)
num3 3 (numeric keypad)
num4 4 (numeric keypad)
num5 5 (numeric keypad)
num6 6 (numeric keypad)
num7 7 (numeric keypad)
num8 8 (numeric keypad)
num9 9 (numeric keypad)
num0 0 (numeric keypad)
numperiod . (numeric keypad)
numend End (numeric keypad)
numdown Down (numeric keypad)
numpgdown Page Down (numeric keypad)
numleft Left (numeric keypad)
numcenter 5 with Num Lock inactive (numeric keypad)
numright Right (numeric keypad)
numhome Home (numeric keypad)
numup Up (numeric keypad)
numpgup Page Up (numeric keypad)
numinsert Insert (numeric keypad)
numdelete Delete (numeric keypad)
numasterisk * (numeric keypad)
numminus - (numeric keypad)
numplus + (numeric keypad)
numslash / (numeric keypad)
numenter Enter (numeric keypad)
menghapus Hapus
menyisipkan Menyisipkan
rumah Rumah
akhir Akhir
pgdown Halaman Bawah
pgup Page Up
turun Turun
naik Naik
kiri Kiri
tepat Tepat
As well as keystrokes, the sendkey command takes various options that affect the BIOS keyboard status flags. These options take an ' on ' or ' off ' parameter, specifying that the corresponding status flag be set or unset; omitting the option for a given status flag will leave that flag at its initial state at boot. The --num , --caps , --scroll , and --insert options emulate setting the corresponding mode, while the --numkey , --capskey , --scrollkey , and --insertkey options emulate pressing and holding the corresponding key. The other status flag options are self-explanatory.
If the --no-led option is given, the status flag options will have no effect on keyboard LEDs.
If the sendkey command is given multiple times, then only the last invocation has any effect.
Since sendkey manipulates the BIOS keyboard buffer, it may cause hangs, reboots, or other misbehaviour on some systems. If the operating system or boot loader that runs after GRUB uses its own keyboard driver rather than the BIOS keyboard functions, then sendkey will have no effect.
This command is only available on PC BIOS systems.

14.3.42 set

— Command: set [ envvar=value ]
Set the environment variable envvar to value . If invoked with no arguments, print all environment variables with their values.

14.3.43 true

— Command: true
Do nothing, successfully. This is mainly useful in control constructs such as if and while (see Shell-like scripting ).

14.3.44 unset

— Command: unset envvar
Unset the environment variable envvar .

14.3.45 uppermem

This command is not yet implemented for GRUB 2, although it is planned.

Next: , Previous: Commands , Up: Top

15 Charset

GRUB uses UTF-8 internally other than in rendering where some GRUB-specific appropriate representation is used. All text files (including config) are assumed to be encoded in UTF-8.

16 Filesystems

NTFS, JFS, UDF, HFS+, exFAT, long filenames in FAT, Joliet part of ISO9660 are treated as UTF-16 as per specification. AFS and BFS are read as UTF-8, again according to specification. BtrFS, cpio, tar, squash4, minix, minix2, minix3, ROMFS, ReiserFS, XFS, ext2, ext3, ext4, FAT (short names), RockRidge part of ISO9660, nilfs2, UFS1, UFS2 and ZFS are assumed to be UTF-8. This might be false on systems configured with legacy charset but as long as the charset used is superset of ASCII you should be able to access ASCII-named files. And it's recommended to configure your system to use UTF-8 to access the filesystem, convmv may help with migration. ISO9660 (plain) filenames are specified as being ASCII or being described with unspecified escape sequences. GRUB assumes that the ISO9660 names are UTF-8 (since any ASCII is valid UTF-8). There are some old CD-ROMs which use CP437 in non-compliant way. You're still able to access files with names containing only ASCII characters on such filesystems though. You're also able to access any file if the filesystem contains valid Joliet (UTF-16) or RockRidge (UTF-8). AFFS, SFS and HFS never use unicode and GRUB assumes them to be in Latin1, Latin1 and MacRoman respectively. GRUB handles filesystem case-insensitivity however no attempt is performed at case conversion of international characters so eg a file named lowercase greek alpha is treated as different from the one named as uppercase alpha. The filesystems in questions are NTFS (except POSIX namespace), HFS+ (configurable at mkfs time, default insensitive), SFS (configurable at mkfs time, default insensitive), JFS (configurable at mkfs time, default sensitive), HFS, AFFS, FAT, exFAT and ZFS (configurable on per-subvolume basis by property “casesensitivity”, default sensitive). On ZFS subvolumes marked as case insensitive files containing lowercase international characters are inaccessible. Also like all supported filesystems except HFS+ and ZFS (configurable on per-subvolume basis by property “normalization”, default none) GRUB makes no attempt at check of canonical equivalence so a file name u-diaresis is treated as distinct from u+combining diaresis. This however means that in order to access file on HFS+ its name must be specified in normalisation form D. On normalized ZFS subvolumes filenames out of normalisation are inaccessible.

17 Output terminal

Firmware output console “console” on ARC and IEEE1275 are limited to ASCII. BIOS firmware console and VGA text are limited to ASCII and some pseudographics. None of above mentioned is appropriate for displaying international and any unsupported character is replaced with question mark except pseudographics which we attempt to approximate with ASCII. EFI console on the other hand nominally supports UTF-16 but actual language coverage depends on firmware and may be very limited. The encoding used on serial can be chosen with terminfo as either ASCII, UTF-8 or “visual UTF-8”. Last one is against the specification but results in correct rendering of right-to-left on some readers which don't have own bidi implementation. When using gfxterm or gfxmenu GRUB itself is responsible for rendering the text. In this case GRUB is limited by loaded fonts. If fonts contain all required characters then bidirectional text, cursive variants and combining marks other than enclosing, half (eg left half tilde or combining overline) and double ones. Ligatures aren't supported though. This should cover European, Middle Eastern (if you don't mind lack of lam-alif ligature in Arabic) and East Asian scripts. Notable unsupported scripts are Brahmic family and derived as well as Mongolian, Tifinagh, Korean Jamo (precomposed characters have no problem) and tonal writing (2e5-2e9). GRUB also ignores deprecated (as specified in Unicode) characters (eg tags). GRUB also doesn't handle so called “annotation characters” If you can complete either of two lists or, better, propose a patch to improve rendering, please contact developper team.

18 Input terminal

Firmware console on BIOS, IEEE1275 and ARC doesn't allow you to enter non-ASCII characters. EFI specification allows for such but author is unaware of any actual implementations. Serial input is currently limited for latin1 (unlikely to change). Own keyboard implementations (at_keyboard and usb_keyboard) supports any key but work on one-char-per-keystroke. So no dead keys or advanced input method. Also there is no keymap change hotkey. In practice it makes difficult to enter any text using non-Latin alphabet. Moreover all current input consumers are limited to ASCII.

19 Gettext

GRUB supports being translated. For this you need to have language *.mo files in $prefix/locale, load gettext module and set “lang” variable.

20 Regexp

Regexps work on unicode characters, however no attempt at checking cannonical equivalence has been made. Moreover the classes like [:alpha:] match only ASCII subset.

21 Other

Currently GRUB always uses YEAR-MONTH-DAY HOUR:MINUTE:SECOND [WEEKDAY] 24-hour datetime format but weekdays are translated. GRUB always uses the decimal number format with [0-9] as digits and . as descimal separator and no group separator. IEEE1275 aliases are matched case-insensitively except non-ASCII which is matched as binary. Similar behaviour is for matching OSBundleRequired. Since IEEE1275 aliases and OSBundleRequired don't contain any non-ASCII it should never be a problem in practice. Case-sensitive identifiers are matched as raw strings, no canonical equivalence check is performed. Case-insenstive identifiers are matched as RAW but additionally [az] is equivalent to [AZ]. GRUB-defined identifiers use only ASCII and so should user-defined ones. Identifiers containing non-ASCII may work but aren't supported. Only the ASCII space characters (space U+0020, tab U+000b, CR U+000d and LF U+000a) are recognised. Other unicode space characters aren't a valid field separator. test tests <, >, <=, >=, -pgt and -plt compare the strings in the lexicographical order of unicode codepoints, replicating the behaviour of test from coreutils. environment variables and commands are listed in the same order.

22 Authentication and authorisation

By default, the boot loader interface is accessible to anyone with physical access to the console: anyone can select and edit any menu entry, and anyone can get direct access to a GRUB shell prompt. For most systems, this is reasonable since anyone with direct physical access has a variety of other ways to gain full access, and requiring authentication at the boot loader level would only serve to make it difficult to recover broken systems.
However, in some environments, such as kiosks, it may be appropriate to lock down the boot loader to require authentication before performing certain operations.
The ' password ' (see password ) and ' password_pbkdf2 ' (see password_pbkdf2 ) commands can be used to define users, each of which has an associated password. ' password ' sets the password in plain text, requiring grub.cfg to be secure; ' password_pbkdf2 ' sets the password hashed using the Password-Based Key Derivation Function (RFC 2898), requiring the use of grub-mkpasswd-pbkdf2 (see Invoking grub-mkpasswd-pbkdf2 ) to generate password hashes.
In order to enable authentication support, the ' superusers ' environment variable must be set to a list of usernames, separated by any of spaces, commas, semicolons, pipes, or ampersands. Superusers are permitted to use the GRUB command line, edit menu entries, and execute any menu entry. If ' superusers ' is set, then use of the command line is automatically restricted to superusers.
Other users may be given access to specific menu entries by giving a list of usernames (as above) using the --users option to the ' menuentry ' command (see menuentry ). If the --unrestricted option is used for a menu entry, then that entry is unrestricted. If the --users option is not used for a menu entry, then that only superusers are able to use it.
Putting this together, a typical grub.cfg fragment might look like this:
 set superusers="root"
     password_pbkdf2 root grub.pbkdf2.sha512.10000.biglongstring
     password user1 insecure
     
     menuentry "May be run by any user" --unrestricted {
     	 set root = (hd0, 1)
     	linux /vmlinuz
      }
     
     menuentry "Superusers only" --users "" {
     	 set root = (hd0, 1)
     	linux /vmlinuz single
      }
     
     menuentry "May be run by user1 or a superuser" --users user1 {
     	set root=(hd0,2)
     	 chainloader +1
      }
The grub-mkconfig program does not yet have built-in support for generating configuration files with authentication. You can use /etc/grub.d/40_custom to add simple superuser authentication, by adding set superusers= and password or password_pbkdf2 commands.

Next: , Previous: Security , Up: Top

23 Platform limitations

GRUB2 is designed to be portable and is actually ported across platforms. We try to keep all platforms at the level. Unfortunately some platforms are better supported than others. This is detailed in current and 2 following sections.
ARC platform is unable to change datetime (firmware doesn't seem to provide a function for it). EMU has similar limitation.
ARC platform no serial port is available. EMU has similar limitation.
Console charset refers only to firmware-assisted console. gfxterm is always Unicode (see Internationalisation section for its limitations). Serial is configurable to UTF-8 or ASCII (see Internationalisation). In case of qemu and coreboot ports the refered console is vga_text. Loongson always uses gfxterm.
Most limited one is ASCII. CP437 provides additionally pseudographics. GRUB2 doesn't use any language characters from CP437 as often CP437 is replaced by national encoding compatible only in pseudographics. Unicode is the most versatile charset which supports many languages. However the actual console may be much more limited depending on firmware
On BIOS network is supported only if the image is loaded through network. On sparc64 GRUB is unable to determine which server it was booted from.
On platforms not having direct serial support (as indicated in the line serial) you can still redirect firmware console to serial if it allows so.
Direct ATA/AHCI support allows to circumvent various firmware limitations but isn't needed for normal operation except on baremetal ports.
AT keyboard support allows keyboard layout remapping and support for keys not available through firmware. It isn't needed for normal operation except baremetal ports.
USB support provides benefits similar to ATA (for USB disks) or AT (for USB keyboards). In addition it allows USBserial.
Chainloading refers to the ability to load another bootloader through the same protocol
Hints allow faster disk discovery by already knowing in advance which is the disk in question. On some platforms hints are correct unless you move the disk between boots. On other platforms it's just an educated guess. Note that hint failure results in just reduced performance, not a failure
BadRAM is the ability to mark some of the RAM as “bad”. Note: due to protocol limitations mips-loongson (with Linux protocol) and mips-qemu_mips can use only memory up to first hole.

BIOS Coreboot Multiboot Qemu
Video ya ya ya ya
console charset CP437 CP437 CP437 CP437
jaringan yes (*) tidak tidak tidak
ATA/AHCI ya ya ya ya
AT Keyboard ya ya ya ya
USB ya ya ya ya
chainloader lokal ya ya tidak
cpuid sebagian sebagian sebagian sebagian
hints kira kira kira kira
PCI ya ya ya ya
badram ya ya ya ya
kompresi selalu tak berarti tidak tidak
keluar ya tidak tidak tidak

ia32 EFI amd64 EFI ia32 IEEE1275 Itanium
Video ya ya tidak tidak
console charset Unicode Unicode ASCII Unicode
jaringan ya ya ya ya
ATA/AHCI ya ya ya tidak
AT Keyboard ya ya ya tidak
USB ya ya ya tidak
chainloader lokal lokal tidak lokal
cpuid sebagian sebagian sebagian tidak
hints kira kira baik kira
PCI ya ya ya tidak
badram ya ya tidak ya
kompresi tidak tidak tidak tidak
keluar ya ya ya ya

Loongson sparc64 Powerpc ARC
Video ya tidak ya tidak
console charset N / A ASCII ASCII ASCII
jaringan tidak yes (*) ya tidak
ATA/AHCI ya tidak tidak tidak
AT Keyboard ya tidak tidak tidak
USB ya tidak tidak tidak
chainloader ya tidak tidak tidak
cpuid tidak tidak tidak tidak
hints baik baik baik tidak
PCI ya tidak tidak tidak
badram yes (*) tidak tidak tidak
kompresi configurable tidak tidak configurable
keluar tidak ya ya ya

MIPS qemu emu
Video tidak ya
console charset CP437 ASCII
jaringan tidak ya
ATA/AHCI ya tidak
AT Keyboard ya tidak
USB N / A ya
chainloader ya tidak
cpuid tidak tidak
hints kira tidak
PCI tidak tidak
badram yes (*) tidak
kompresi configurable tidak
keluar tidak ya

Next: , Previous: Platform limitations , Up: Top

24 Outline

Some platforms have features which allows to implement some commands useless or not implementable on others.
Quick summary:
Information retrieval:
  • mipsel-loongson: lsspd
  • mips-arc: lsdev
  • efi: lsefisystab, lssal, lsefimmap
  • i386-pc: lsapm
  • acpi-enabled (i386-pc, i386-coreboot, i386-multiboot, *-efi): lsacpi
Workarounds for platform-specific issues:
  • i386-efi/x86_64-efi: loadbios, fixvideo
  • acpi-enabled (i386-pc, i386-coreboot, i386-multiboot, *-efi): acpi (override ACPI tables)
  • i386-pc: drivemap
  • i386-pc: sendkey
Advanced operations for power users:
  • x86: iorw (direct access to I/O ports)
Miscelaneous:
  • cmos (x86-*, ieee1275, mips-qemu_mips, mips-loongson): cmostest (used on some laptops to check for special power-on key)
  • i386-pc: play

25 Supported boot targets

X86 support is summarised in the following table. “Yes” means that the kernel works on the given platform, “crashes” means an early kernel crash which we hope will be fixed by concerned kernel developers. “no” means GRUB doesn't load the given kernel on a given platform. “headless” means that the kernel works but lacks console drivers (you can still use serial or network console). In case of “no” and “crashes” the reason is given in footnote.

BIOS Coreboot
BIOS chainloading ya no (1)
NTLDR ya no (1)
Plan9 ya no (1)
Freedos ya no (1)
FreeBSD bootloader ya crashes (1)
32-bit kFreeBSD ya crashes (2,6)
64-bit kFreeBSD ya crashes (2,6)
32-bit kNetBSD ya crashes (1)
64-bit kNetBSD ya crashes (2)
32-bit kOpenBSD ya ya
64-bit kOpenBSD ya ya
Multiboot ya ya
Multiboot2 ya ya
32-bit Linux (legacy protocol) ya no (1)
64-bit Linux (legacy protocol) ya no (1)
32-bit Linux (modern protocol) ya ya
64-bit Linux (modern protocol) ya ya
32-bit XNU ya ?
64-bit XNU ya ?
32-bit EFI chainloader no (3) no (3)
64-bit EFI chainloader no (3) no (3)
Appleloader no (3) no (3)

Multiboot Qemu
BIOS chainloading no (1) no (1)
NTLDR no (1) no (1)
Plan9 no (1) no (1)
FreeDOS no (1) no (1)
FreeBSD bootloader crashes (1) crashes (1)
32-bit kFreeBSD crashes (6) crashes (6)
64-bit kFreeBSD crashes (6) crashes (6)
32-bit kNetBSD crashes (1) crashes (1)
64-bit kNetBSD ya ya
32-bit kOpenBSD ya ya
64-bit kOpenBSD ya ya
Multiboot ya ya
Multiboot2 ya ya
32-bit Linux (legacy protocol) no (1) no (1)
64-bit Linux (legacy protocol) no (1) no (1)
32-bit Linux (modern protocol) ya ya
64-bit Linux (modern protocol) ya ya
32-bit XNU ? ?
64-bit XNU ? ?
32-bit EFI chainloader no (3) no (3)
64-bit EFI chainloader no (3) no (3)
Appleloader no (3) no (3)

ia32 EFI amd64 EFI
BIOS chainloading no (1) no (1)
NTLDR no (1) no (1)
Plan9 no (1) no (1)
FreeDOS no (1) no (1)
FreeBSD bootloader crashes (1) crashes (1)
32-bit kFreeBSD dungu dungu
64-bit kFreeBSD dungu dungu
32-bit kNetBSD crashes (1) crashes (1)
64-bit kNetBSD ya ya
32-bit kOpenBSD dungu dungu
64-bit kOpenBSD dungu dungu
Multiboot ya ya
Multiboot2 ya ya
32-bit Linux (legacy protocol) no (1) no (1)
64-bit Linux (legacy protocol) no (1) no (1)
32-bit Linux (modern protocol) ya ya
64-bit Linux (modern protocol) ya ya
32-bit XNU ya ya
64-bit XNU yes (5) ya
32-bit EFI chainloader ya no (4)
64-bit EFI chainloader no (4) ya
Appleloader ya ya

ia32 IEEE1275
BIOS chainloading no (1)
NTLDR no (1)
Plan9 no (1)
FreeDOS no (1)
FreeBSD bootloader crashes (1)
32-bit kFreeBSD crashes (6)
64-bit kFreeBSD crashes (6)
32-bit kNetBSD crashes (1)
64-bit kNetBSD ?
32-bit kOpenBSD ?
64-bit kOpenBSD ?
Multiboot ?
Multiboot2 ?
32-bit Linux (legacy protocol) no (1)
64-bit Linux (legacy protocol) no (1)
32-bit Linux (modern protocol) ?
64-bit Linux (modern protocol) ?
32-bit XNU ?
64-bit XNU ?
32-bit EFI chainloader no (3)
64-bit EFI chainloader no (3)
Appleloader no (3)
  1. Requires BIOS
  2. Crashes because the memory at 0x0-0x1000 isn't available
  3. EFI only
  4. 32-bit and 64-bit EFI have different structures and work in different CPU modes so it's not possible to chainload 32-bit bootloader on 64-bit platform and vice-versa
  5. Some modules may need to be disabled
  6. Membutuhkan ACPI
PowerPC, IA64 and Sparc64 ports support only Linux. MIPS port supports Linux and multiboot2.

26 Boot tests

As you have seen in previous chapter the support matrix is pretty big and some of the configurations are only rarely used. To ensure the quality bootchecks are available for all x86 targets except EFI chainloader, Appleloader and XNU. All x86 platforms have bootcheck facility except ieee1275. Multiboot, multiboot2, BIOS chainloader, ntldr and freebsd-bootloader boot targets are tested only with a fake kernel images. Only Linux is tested among the payloads using Linux protocols.
Following variables must be defined:
GRUB_PAYLOADS_DIR directory containing the required kernels
GRUB_CBFSTOOL cbfstoll from Coreboot package (for coreboot platform only)
GRUB_COREBOOT_ROM empty Coreboot ROM
GRUB_QEMU_OPTS additional options to be supplied to QEMU
Required files are:
kfreebsd_env.i386 32-bit kFreeBSD device hints
kfreebsd.i386 32-bit FreeBSD kernel image
kfreebsd.x86_64, kfreebsd_env.x86_64 same from 64-bit kFreeBSD
knetbsd.i386 32-bit NetBSD kernel image
knetbsd.miniroot.i386 32-bit kNetBSD miniroot.kmod.
knetbsd.x86_64, knetbsd.miniroot.x86_64 same from 64-bit kNetBSD
kopenbsd.i386 32-bit OpenBSD kernel bsd.rd image
kopenbsd.x86_64 same from 64-bit kOpenBSD
linux.i386 32-bit Linux
linux.x86_64 64-bit Linux

Next: , Previous: Supported kernels , Up: Top

27 Error messages produced by GRUB

27.1 GRUB only offers a rescue shell

GRUB's normal start-up procedure involves setting the ' prefix ' environment variable to a value set in the core image by grub-install , setting the ' root ' variable to match, loading the ' normal ' module from the prefix, and running the ' normal ' command (see normal ). This command is responsible for reading /boot/grub/grub.cfg , running the menu, and doing all the useful things GRUB is supposed to do.
If, instead, you only get a rescue shell, this usually means that GRUB failed to load the ' normal ' module for some reason. It may be possible to work around this temporarily: for instance, if the reason for the failure is that ' prefix ' is wrong (perhaps it refers to the wrong device, or perhaps the path to /boot/grub was not correctly made relative to the device), then you can correct this and enter normal mode manually:
 # Inspect the current prefix (and other preset variables):
      mengatur
     # Find out which devices are available:
      ls
     # Set to the correct value, which might be something like this:
     set prefix=(hd0,1)/grub
      set root = (hd0, 1)
     insmod normal
      normal
However, any problem that leaves you in the rescue shell probably means that GRUB was not correctly installed. It may be more useful to try to reinstall it properly using grub-install device (see Invoking grub-install ). When doing this, there are a few things to remember:
  • Drive ordering in your operating system may not be the same as the boot drive ordering used by your firmware. Do not assume that your first hard drive (eg ' /dev/sda ') is the one that your firmware will boot from. device.map (see Device map ) can be used to override this, but it is usually better to use UUIDs or file system labels and avoid depending on drive ordering entirely.
  • At least on BIOS systems, if you tell grub-install to install GRUB to a partition but GRUB has already been installed in the master boot record, then the GRUB installation in the partition will be ignored.
  • If possible, it is generally best to avoid installing GRUB to a partition (unless it is a special partition for the use of GRUB alone, such as the BIOS Boot Partition used on GPT). Doing this means that GRUB may stop being able to read its core image due to a file system moving blocks around, such as while defragmenting, running checks, or even during normal operation. Installing to the whole disk device is normally more robust.
  • Check that GRUB actually knows how to read from the device and file system containing /boot/grub . It will not be able to read from encrypted devices, nor from file systems for which support has not yet been added to GRUB.

Next: , Previous: Troubleshooting , Up: Top

28 Invoking grub-install

The program grub-install installs GRUB on your drive using grub-mkimage and (on some platforms) grub-setup . You must specify the device name on which you want to install GRUB, like this:
 grub-install install_device
The device name install_device is an OS device name or a GRUB device name.
grub-install accepts the following options:
--help
Print a summary of the command-line options and exit.
--version
Print the version number of GRUB and exit.
--boot-directory= dir
Install GRUB images under the directory dir /grub/ This option is useful when you want to install GRUB into a separate partition or a removable disk. If this option is not specified then it defaults to /boot , so
 grub-install /dev/sda
is equivalent to
 grub-install --boot-directory=/boot/ /dev/sda
Here is an example in which you have a separate boot partition which is mounted on /mnt/boot :
 grub-install --boot-directory=/mnt/boot /dev/sdb
--recheck
Recheck the device map, even if /boot/grub/device.map already exists. You should use this option whenever you add/remove a disk into/from your computer.

29 Invoking grub-mkconfig

The program grub-mkconfig generates a configuration file for GRUB (see Simple configuration ).
 grub-mkconfig -o /boot/grub/grub.cfg
grub-mkconfig accepts the following options:
--help
Print a summary of the command-line options and exit.
--version
Print the version number of GRUB and exit.
-o file
--output= file
Send the generated configuration file to file . The default is to send it to standard output.

30 Invoking grub-mkpasswd-pbkdf2

The program grub-mkpasswd-pbkdf2 generates password hashes for GRUB (see Security ).
 grub-mkpasswd-pbkdf2
grub-mkpasswd-pbkdf2 accepts the following options:
-c number
--iteration-count= number
Number of iterations of the underlying pseudo-random function. Defaults to 10000.
-l number
--buflen= number
Length of the generated hash. Defaults to 64.
-s number
--salt= number
Length of the salt. Defaults to 64.

31 Invoking grub-mkrescue

The program grub-mkrescue generates a bootable GRUB rescue image (see Making a GRUB bootable CD-ROM ).
 grub-mkrescue -o grub.iso
All arguments not explicitly listed as grub-mkrescue options are passed on directly to xorriso in mkisofs emulation mode. Options passed to xorriso will normally be interpreted as mkisofs options; if the option ' -- ' is used, then anything after that will be interpreted as native xorriso options.
Non-option arguments specify additional source directories. This is commonly used to add extra files to the image:
 mkdir -p disk/boot/grub
     (add extra files to disk/boot/grub )
     grub-mkrescue -o grub.iso disk
grub-mkrescue accepts the following options:
--help
Print a summary of the command-line options and exit.
--version
Print the version number of GRUB and exit.
-o file
--output= file
Save output in file . This "option" is required.
--modules= modules
Pre-load the named GRUB modules in the image. Multiple entries in modules should be separated by whitespace (so you will probably need to quote this for your shell).
--rom-directory= dir
If generating images for the QEMU or Coreboot platforms, copy the resulting qemu.img or coreboot.elf files respectively to the dir directory as well as including them in the image.
--xorriso= file
Use file as the xorriso program, rather than the built-in default.
--grub-mkimage= file
Use file as the grub-mkimage program, rather than the built-in default.

32 Invoking grub-probe

The program grub-probe probes device information for a given path or device.
 grub-probe --target=fs /boot/grub
     grub-probe --target=drive --device /dev/sda1
grub-probe must be given a path or device as a non-option argument, and also accepts the following options:
--help
Print a summary of the command-line options and exit.
--version
Print the version number of GRUB and exit.
-d
--device
If this option is given, then the non-option argument is a system device name (such as ' /dev/sda1 '), and grub-probe will print information about that device. If it is not given, then the non-option argument is a filesystem path (such as ' /boot/grub '), and grub-probe will print information about the device containing that part of the filesystem.
-m file
--device-map= file
Use file as the device map (see Device map ) rather than the default, usually ' /boot/grub/device.map '.
-t target
--target= target
Print information about the given path or device as defined by target . The available targets and their meanings are:
' fs '
GRUB filesystem module.
' fs_uuid '
Filesystem Universally Unique Identifier (UUID).
' fs_label '
Filesystem label.
' drive '
GRUB device name.
' device '
System device name.
' partmap '
GRUB partition map module.
' abstraction '
GRUB abstraction module (eg ' lvm ').
' cryptodisk_uuid '
Crypto device UUID.
' msdos_parttype '
MBR partition type code (two hexadecimal digits).
' hints_string '
A string of platform search hints suitable for passing to the search command (see search ).
' bios_hints '
Search hints for the PC BIOS platform.
' ieee1275_hints '
Search hints for the IEEE1275 platform.
' baremetal_hints '
Search hints for platforms where disks are addressed directly rather than via firmware.
' efi_hints '
Search hints for the EFI platform.
' arc_hints '
Search hints for the ARC platform.
' compatibility_hint '
A guess at a reasonable GRUB drive name for this device, which may be used as a fallback if the search command fails.
' disk '
System device name for the whole disk.
-V
--verbose
Print verbose messages.

Next: , Previous: Invoking grub-probe , Up: Top

Appendix A How to obtain and build GRUB

Caution: GRUB requires binutils-2.9.1.0.23 or later because the GNU assembler has been changed so that it can produce real 16bits machine code between 2.9.1 and 2.9.1.0.x. See http://sources.redhat.com/binutils/ , to obtain information on how to get the latest version.
GRUB is available from the GNU alpha archive site ftp://ftp.gnu.org/gnu/grub or any of its mirrors. The file will be named grub-version.tar.gz. The current version is 2.00~rc1, so the file you should grab is:
ftp://ftp.gnu.org/gnu/grub/grub-2.00~rc1.tar.gz
To unbundle GRUB use the instruction:
 zcat grub-2.00~rc1.tar.gz | tar xvf -
which will create a directory called grub-2.00~rc1 with all the sources. You can look at the file INSTALL for detailed instructions on how to build and install GRUB, but you should be able to just do:
 cd grub-2.00~rc1
      / Configure.
      make install
Also, the latest version is available using Bazaar. See http://www.gnu.org/software/grub/grub-download.en.html for more information.

Next: , Previous: Obtaining and Building GRUB , Up: Top

Appendix B Reporting bugs

These are the guideline for how to report bugs. Take a look at this list below before you submit bugs:
  1. Before getting unsettled, read this manual through and through. Also, see the GNU GRUB FAQ .
  2. Always mention the information on your GRUB. The version number and the configuration are quite important. If you build it yourself, write the options specified to the configure script and your operating system, including the versions of gcc and binutils.
  3. If you have trouble with the installation, inform us of how you installed GRUB. Don't omit error messages, if any. Just ' GRUB hangs up when it boots ' is not enough. The information on your hardware is also essential. These are especially important: the geometries and the partition tables of your hard disk drives and your BIOS.
  4. If GRUB cannot boot your operating system, write down everything you see on the screen. Don't paraphrase them, like ' The foo OS crashes with GRUB, even though it can boot with the bar boot loader just fine '. Mention the commands you executed, the messages printed by them, and information on your operating system including the version number.
  5. Explain what you wanted to do. It is very useful to know your purpose and your wish, and how GRUB didn't satisfy you.
  6. If you can investigate the problem yourself, please do. That will give you and us much more information on the problem. Attaching a patch is even better. When you attach a patch, make the patch in unified diff format, and write ChangeLog entries. But, even when you make a patch, don't forget to explain the problem, so that we can understand what your patch is for.
  7. Write down anything that you think might be related. Please understand that we often need to reproduce the same problem you encountered in our environment. So your information should be sufficient for us to do the same thing—Don't forget that we cannot see your computer directly. If you are not sure whether to state a fact or leave it out, state it! Reporting too many things is much better than omitting something important.
If you follow the guideline above, submit a report to the Bug Tracking System . Alternatively, you can submit a report via electronic mail to bug-grub@gnu.org , but we strongly recommend that you use the Bug Tracking System, because e-mail can be passed over easily.
Once we get your report, we will try to fix the bugs.

Next: , Previous: Reporting bugs , Up: Top

Appendix C Where GRUB will go

GRUB 2 is now quite stable and used in many production systems. We are currently working towards a 2.0 release.
If you are interested in the development of GRUB 2, take a look at the homepage .

Next: , Previous: Future , Up: Top

Appendix D Copying This Manual

D.1 GNU Free Documentation License


Version 1.2, November 2002
 Copyright © 2000,2001,2002 Free Software Foundation, Inc.
     51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
     
      Semua orang diperbolehkan untuk menyalin dan mendistribusikan salinan verbatim
      dari dokumen lisensi ini, tetapi mengubahnya tidak diperbolehkan.
  1. MUKADIMAH The purpose of this License is to make a manual, textbook, or other functional and useful document free in the sense of freedom: to assure everyone the effective freedom to copy and redistribute it, with or without modifying it, either commercially or noncommercially. Kedua, Lisensi ini menyediakan untuk penulis dan penerbit cara untuk mendapatkan penghargaan bagi karya mereka, tanpa dianggap bertanggung jawab terhadap modifikasi yang dilakukan oleh orang lain.
    This License is a kind of “copyleft”, which means that derivative works of the document must themselves be free in the same sense. Ini melengkapi GNU General Public License, yang merupakan suatu lisensi copyleft yang dirancang bagi perangkat lunak bebas.
    Kami telah merancang Lisensi ini untuk menggunakannya bagi manual perangkat lunak bebas, karena perangkat lunak bebas membutuhkan dokumentasi bebas: sebuah program bebas harus disertai dengan manual yang menyediakan kebebasan yang sama yang disediakan perangkat lunaknya. Namun Lisensi ini tidak dibatasi hanya untuk manual perangkat lunak, dapat digunakan untuk segala karya tekstual, tak tergantung bahasan subjek atau apakah ia diterbitkan sebagai buku cetak. Kami menganjurkan Lisensi ini terutama bagi karya yang tujuannya adalah sebagai petunjuk atau referensi.
  2. PENERAPAN DAN DEFINISI Lisensi ini berlaku untuk semua manual atau karya lain, dalam setiap media, yang berisi pemberitahuan yang ditempatkan oleh pemegang hak cipta memberitahukan bahwa dapat didistribusikan di bawah persyaratan Lisensi ini. Pernyataan tersebut memberikan sebuah seluruh dunia, bebas royalti lisensi, tanpa batas waktu, untuk menggunakan karya yang di bawah kondisi yang dicantumkan. The “Document”, below, refers to any such manual or work. Any member of the public is a licensee, and is addressed as “you”. Anda menerima lisensi jika Anda menyalin, memodifikasi atau mendistribusikan karya melalui cara yang membutuhkan izin menurut hukum hak cipta.
    A “Modified Version” of the Document means any work containing the Document or a portion of it, either copied verbatim, or with modifications and/or translated into another language.
    A “Secondary Section” is a named appendix or a front-matter section of the Document that deals exclusively with the relationship of the publishers or authors of the Document to the Document's overall subject (or to related matters) and contains nothing that could fall directly within that overall subject. (Jadi, jika Dokumen adalah bagian dari suatu buku teks matematika, suatu Bagian Sekunder tidak boleh menjelaskan masalah matematika.) Hubungan bisa menjadi masalah hubungan historis dengan subjek atau dengan hal-hal yang terkait, atau hukum, komersial, filosofis, etis, atau posisi politis terhadap mereka.
    The “Invariant Sections” are certain Secondary Sections whose titles are designated, as being those of Invariant Sections, in the notice that says that the Document is released under this License. Jika suatu bagian tidak memenuhi definisi mengenai Sekunder di atas, maka tidak diizinkan untuk menyebutnya sebagai Invarian. Dokumen dapat tidak memiliki Bagian Invarian. Jika Dokumen tidak mengidentifikasikan Bagian Invarian manapun maka tidak ada satu pun.
    The “Cover Texts” are certain short passages of text that are listed, as Front-Cover Texts or Back-Cover Texts, in the notice that says that the Document is released under this License. Sebuah Teks Sampul Depan mungkin paling banyak 5 kata, dan Teks Sampul Belakang mungkin paling 25 kata.
    A “Transparent” copy of the Document means a machine-readable copy, represented in a format whose specification is available to the general public, that is suitable for revising the document straightforwardly with generic text editors or (for images composed of pixels) generic paint programs or (for drawings) some widely available drawing editor, and that is suitable for input to text formatters or for automatic translation to a variety of formats suitable for input to text formatters. Salinan yang dibuat dalam format file lain yang Transparan markup, atau tanpa markah, telah diatur untuk menghambat atau menyulitkan modifikasi lanjutan oleh pembaca bukanlah Transparan. Suatu format gambar tidak Transparan jika digunakan untuk jumlah substansial apapun dari teks. A copy that is not “Transparent” is called “Opaque”.
    Examples of suitable formats for Transparent copies include plain ascii without markup, Texinfo input format, LaTeX input format, SGML or XML using a publicly available DTD , and standard-conforming simple HTML , PostScript or PDF designed for human modification. Examples of transparent image formats include PNG , XCF and JPG . Opaque formats include proprietary formats that can be read and edited only by proprietary word processors, SGML or XML for which the DTD and/or processing tools are not generally available, and the machine-generated HTML , PostScript or PDF produced by some word processors for output purposes only.
    The “Title Page” means, for a printed book, the title page itself, plus such following pages as are needed to hold, legibly, the material this License requires to appear in the title page. For works in formats which do not have any title page as such, “Title Page” means the text near the most prominent appearance of the work's title, preceding the beginning of the body of the text.
    A section “Entitled XYZ” means a named subunit of the Document whose title either is precisely XYZ or contains XYZ in parentheses following text that translates XYZ in another language. (Here XYZ stands for a specific section name mentioned below, such as “Acknowledgements”, “Dedications”, “Endorsements”, or “History”.) To “Preserve the Title” of such a section when you modify the Document means that it remains a section “Entitled XYZ” according to this definition.
    Dokumen tersebut dapat mencakup Penyangkalan Jaminan sebelah pemberitahuan yang menyatakan bahwa Lisensi ini berlaku untuk Dokumen. Penyangkalan Jaminan ini dianggap dimasukkan oleh referensi dalam Lisensi ini, tetapi hanya dalam hal jaminan disclaiming: ada implikasi lainnya bahwa Penyangkalan Jaminan mungkin adalah membatalkan dan tidak berpengaruh pada arti Lisensi ini.
  3. VERBATIM COPYING Anda dapat menyalin dan mendistribusikan Dokumen dalam medium apapun, baik secara komersial maupun non-komersial, asalkan Lisensi ini, pernyataan hak cipta, dan pernyataan lisensi yang menyatakan bahwa Lisensi ini berlaku untuk Dokumen direproduksikan pada semua salinan, dan Anda tidak menambahkan kondisi lain apapun kepada mereka dari Lisensi ini. Anda tidak dapat menggunakan alat teknis untuk menghambat atau mengontrol pembacaan atau penyalinan ulang dari salinan yang Anda buat atau distribusikan. Namun, Anda mungkin menerima kompensasi dalam pertukaran untuk salinan. Jika Anda mendistribusikan jumlah salinan yang cukup banyak Anda harus mematuhi kondisi pada bagian 3.
    Anda juga dapat meminjamkan salinan, di bawah kondisi yang sama dinyatakan di atas, dan Anda dapat menampilkan salinan publik.
  4. COPYING DALAM JUMLAH Jika Anda menerbitkan salinan tercetak (atau salinan dalam media yang umumnya memiliki sampul tercetak) dari Dokumen, dengan jumlah lebih dari 100, dan pernyataan lisensi Dokumen mensyaratkan Teks Sampul, Anda harus menyertakan salinannya pada sampul yang mencakup, dengan jelas dan terbaca, semua Teks Sampul: Teks Sampul Depan di sampul depan, dan Teks Sampul Belakang pada sampul belakang. Kedua sampul harus secara jelas dan terbaca mengidentifikasikan Anda sebagai penerbit salinan ini. Sampul muka harus menampilkan judul lengkap dengan semua kata-kata dari judul sama menonjol dan jelas. Anda dapat menambahkan bahan lain pada sampul di samping. Salinan dengan perubahan yang dibatasi hanya pada sampul, selama mereka mempertahankan judul Dokumen dan memenuhi kondisi tersebut, dapat dianggap sebagai salinan verbatim dalam hal lain.
    Jika teks yang dibutuhkan untuk kedua sampul terlalu banyak untuk tetap terbaca, Anda harus meletakkan yang pertama terdaftar (sebanyak muat cukup) pada penutup yang sebenarnya, dan melanjutkan sisanya pada halaman berikut.
    Jika Anda menerbitkan atau mendistribusikan salinan Buram dari dokumen berjumlah lebih dari 100, Anda harus menyertakan salinan mesin-dibaca Transparan bersama dengan tiap salinan Buram, atau menyatakan dalam atau dengan tiap salinan Buram suatu lokasi jaringan komputer dari mana jaringan umum- menggunakan masyarakat memiliki akses untuk men-download menggunakan protokol jaringan standar publik suatu salinan Transparan lengkap dari Dokumen, bebas dari bahan tambahan. Jika Anda memilih opsi terakhir, Anda harus mengambil langkah-langkah yang memadai sewaktu mulai mendistribusikan salinan Buram dalam jumlah, untuk memastikan bahwa salinan Transparan ini akan tetap dapat diakses pada lokasi yang dinyatakan sampai setidaknya satu tahun setelah terakhir kali Anda melakukan distribusi Buram copy (langsung atau melalui agen atau pengecer) dari edisi tersebut kepada publik.
    Hal ini diminta, tetapi tidak diperlukan, bahwa Anda menghubungi pencipta Dokumen sebelum mendistribusikan ulang sejumlah besar salinan, untuk memberi mereka kesempatan untuk menyediakan Anda dengan versi terbaru dari Dokumen.
  5. MODIFIKASI Anda dapat menyalin dan mendistribusikan Versi Modifikasi dari Dokumen sesuai dengan kondisi pada bagian 2 dan 3 di atas, asalkan Anda merilis Versi Modifikasi tersebut tepat sesuai Lisensi ini, dengan Versi Modifikasi mengisi posisi Dokumen, sehingga distribusi lisensi dan modifikasi Versi Modifikasi pada siapapun yang memiliki salinannya. Selain itu, Anda harus melakukan hal-hal pada Versi Modifikasi:
    1. Use in the Title Page (and on the covers, if any) a title distinct from that of the Document, and from those of previous versions (which should, if there were any, be listed in the History section of the Document). Anda dapat menggunakan judul yang sama dengan versi sebelumnya jika penerbit asli versi tersebut memberikan izin.
    2. List on the Title Page, as authors, one or more persons or entities responsible for authorship of the modifications in the Modified Version, together with at least five of the principal authors of the Document (all of its principal authors, if it has fewer than five), unless they release you from this requirement.
    3. State on the Title page the name of the publisher of the Modified Version, as the publisher.
    4. Melestarikan semua pemberitahuan hak cipta dari Dokumen.
    5. Add an appropriate copyright notice for your modifications adjacent to the other copyright notices.
    6. Include, immediately after the copyright notices, a license notice giving the public permission to use the Modified Version under the terms of this License, in the form shown in the Addendum below.
    7. Preserve in that license notice the full lists of Invariant Sections and required Cover Texts given in the Document's license notice.
    8. Include an unaltered copy of this License.
    9. Preserve the section Entitled “History”, Preserve its Title, and add to it an item stating at least the title, year, new authors, and publisher of the Modified Version as given on the Title Page. If there is no section Entitled “History” in the Document, create one stating the title, year, authors, and publisher of the Document as given on its Title Page, then add an item describing the Modified Version as stated in the previous sentence.
    10. Preserve the network location, if any, given in the Document for public access to a Transparent copy of the Document, and likewise the network locations given in the Document for previous versions it was based on. These may be placed in the “History” section. Anda dapat mengesampingkan suatu lokasi jaringan untuk suatu karya yang dipublikasikan paling tidak empat tahun sebelum Dokumen itu sendiri, atau jika penerbit asli versi yang dirujuk tersebut memberikan izin.
    11. For any section Entitled “Acknowledgements” or “Dedications”, Preserve the Title of the section, and preserve in the section all the substance and tone of each of the contributor acknowledgements and/or dedications given therein.
    12. Pertahankan semua Bagian Invarian Dokumen, tanpa perubahan pada teks dan judulnya. Nomor bagian atau ekivalennya tidak dianggap sebagai bagian dari judul bagian.
    13. Delete any section Entitled “Endorsements”. Seperti bagian mungkin tidak termasuk dalam Versi Modifikasi.
    14. Do not retitle any existing section to be Entitled “Endorsements” or to conflict in title with any Invariant Section.
    15. Preserve any Warranty Disclaimers.
    Jika Versi Modifikasi menyertakan baru depan atau lampiran yang layak sebagai Bagian Sekunder dan tidak mengandung bahan yang disalin dari Dokumen, Anda dapat sesuai pilihan menyebutkan beberapa atau seluruh bagian tersebut sebagai invarian. Untuk melakukan hal ini, tambahkan judul mereka pada daftar Bagian Invarian dalam pernyataan lisensi Versi Modifikasi. Judul-judul harus dapat dibedakan dengan judul bagian lain.
    You may add a section Entitled “Endorsements”, provided it contains nothing but endorsements of your Modified Version by various parties—for example, statements of peer review or that the text has been approved by an organization as the authoritative definition of a standard.
    Anda dapat menambahkan suatu bagian hingga lima kata sebagai Teks Sampul Depan, dan bagian hingga 25 kata sebagai Teks Sampul Belakang, di akhir daftar Teks Sampul pada Versi Modifikasi. Hanya satu bagian dari Teks Sampul Depan dan salah satu Sampul Belakang Teks dapat ditambahkan oleh (atau melalui pengaturan yang dibuat oleh) satu badan. Jika Dokumen telah mengandung suatu teks sampul untuk sampul yang sama, sebelumnya ditambahkan oleh Anda atau oleh pengaturan yang dibuat oleh entitas yang sama yang Anda bertindak atas nama, Anda tidak dapat menambahkan yang lain, tetapi Anda mungkin menggantikan yang lama, pada izin eksplisit dari penerbit sebelumnya yang menambahkan yang lama.
    Penulis (s) dan penerbit (s) dari Dokumen tidak oleh Lisensi ini memberikan izin untuk menggunakan nama mereka untuk publisitas atau untuk meyakinkan atau memberikan pengesahan terhadap Versi Modifikasi manapun.
  6. MENGGABUNGKAN DOKUMEN Anda dapat menggabungkan Dokumen dengan dokumen lain yang dirilis dengan Lisensi ini, di bawah ketentuan yang ditetapkan dalam bagian 4 di atas untuk versi modifikasi, dengan syarat bahwa Anda termasuk dalam kombinasi dengan semua Bagian Invarian dari semua dokumen asli, tanpa perubahan, dan daftar mereka semua sebagai Bagian Invarian dari karya Anda dikombinasikan pada pernyataan lisensinya, dan bahwa Anda mempertahankan seluruh Penyangkalan Jaminan mereka.
    Karya gabungan tersebut hanya perlu mengandung satu salinan lisensi ini, dan berbagai Bagian Invarian yang identik dapat digantikan dengan satu salinan. Jika ada beberapa Bagian Invarian dengan nama yang sama dengan isi yang berbeda, membuat judul dari setiap bagian tersebut menjadi unik dengan menambahkan pada akhir itu, dalam tanda kurung, nama penulis atau penerbit asli bagian tersebut, jika diketahui, atau yang lain yang unik nomor. Lakukan perubahan yang sama pada judul bagian dalam daftar Bagian Invarian dalam pernyataan lisensi karya gabungan.
    In the combination, you must combine any sections Entitled “History” in the various original documents, forming one section Entitled “History”; likewise combine any sections Entitled “Acknowledgements”, and any sections Entitled “Dedications”. You must delete all sections Entitled “Endorsements.”
  7. KOLEKSI DOKUMEN Anda dapat membuat suatu koleksi yang terdiri dari Dokumen dan dokumen lain yang dirilis dengan Lisensi ini, dan mengganti salinan individu Lisensi ini dalam dokumen dengan satu salinan tunggal yang disertakan dalam koleksi, asalkan Anda mengikuti aturan Lisensi ini untuk verbatim menyalin dari masing-masing dokumen dalam semua aspek lainnya.
    Anda dapat mengekstrak satu dokumen dari koleksi semacam itu, dan mendistribusikannya secara individu dengan Lisensi ini, asalkan Anda menyertakan satu salinan Lisensi ke dalam dokumen hasil ekstraksi, dan mengikuti Lisensi ini dalam semua hal lain yang berkaitan dengan menyalin verbatim dari dokumen itu.
  8. PENGGABUNGAN DENGAN KARYA INDEPENDEN A compilation of the Document or its derivatives with other separate and independent documents or works, in or on a volume of a storage or distribution medium, is called an “aggregate” if the copyright resulting from the compilation is not used to limit the legal rights of the compilation's users beyond what the individual works permit. Ketika Dokumen disertakan dalam suatu agregat, Lisensi ini tidak berlaku terhadap karya lain dalam agregat yang bukan merupakan karya turunan dari Dokumen.
    Jika persyaratan Teks Sampul dari bagian 3 dapat diterapkan pada salinan Dokumen, maka Dokumen kurang dari satu setengah dari keseluruhan agregat, Teks Sampul Dokumen dapat ditempatkan pada sampul yang mencakup Dokumen dalam agregat, atau setara elektronik mencakup jika Dokumen tersebut dalam bentuk elektronik. Jika tidak, mereka harus muncul pada sampul tercetak yang mencakup keseluruhan agregat.
  9. TRANSLATION Terjemahan dianggap suatu bentuk modifikasi, jadi Anda dapat mendistribusikan terjemahan Dokumen mengikuti aturan pada bagian 4. Mengganti Bagian Invarian dengan terjemahan membutuhkan izin khusus dari pemegang hak cipta, tetapi Anda dapat menyertakan terjemahan dari beberapa atau seluruh Bagian Invarian sebagai tambahan dari versi asli Bagian Invarian. Anda dapat menyertakan suatu terjemahan Lisensi ini, dan semua pemberitahuan lisensi dalam Dokumen, dan setiap Penyangkalan Jaminan, dengan syarat bahwa Anda juga menyertakan versi asli bahasa Inggris dari Lisensi ini dan versi asli dari pernyataan dan penyangkalan. Dalam hal terjadi ketidaksesuaian antara terjemahan dan versi asli Lisensi ini atau suatu pernyataan atau penyangkalan, versi asli akan diutamakan.
    If a section in the Document is Entitled “Acknowledgements”, “Dedications”, or “History”, the requirement (section 4) to Preserve its Title (section 1) will typically require changing the actual title.
  10. PENGAKHIRAN You may not copy, modify, sublicense, or distribute the Document except as expressly provided for under this License. Any other attempt to copy, modify, sublicense or distribute the Document is void, and will automatically terminate your rights under this License. Namun, mereka yang sudah mendapatkan salinan, atau hak dari Anda di bawah Lisensi ini tidak akan diakhiri lisensinya asalkan pihak tersebut tetap mematuhi.
  11. REVISI MENDATANG DARI LISENSI INI The Free Software Foundation may publish new, revised versions of the GNU Free Documentation License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. See http://www.gnu.org/copyleft/ .
    Setiap versi Lisensi mendapatkan satu nomor versi yang dapat dibedakan. If the Document specifies that a particular numbered version of this License “or any later version” applies to it, you have the option of following the terms and conditions either of that specified version or of any later version that has been published (not as a draft) by the Free Software Foundation. Jika Dokumen tidak menentukan nomor versi dari Lisensi ini, Anda dapat memilih versi pernah diterbitkan (bukan merupakan draf) oleh Free Software Foundation.

D.1.1 ADDENDUM: How to use this License for your documents

Untuk menggunakan Lisensi ini dalam dokumen yang telah Anda tulis, termasuk salinan Lisensi di dalam dokumen dan menempatkan hak cipta dan pemberitahuan berikut lisensi hanya setelah halaman judul:
 Copyright (C) year your name .
        Izin diberikan untuk menyalin, mendistribusikan dan / atau memodifikasi dokumen ini
       under the terms of the GNU Free Documentation License, Version 1.2
        atau versi berikutnya yang diterbitkan oleh Free Software Foundation;
       with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
       Texts. A copy of the license is included in the section entitled ``GNU
       Free Documentation License''.
If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, replace the “with...Texts.” line with this:
 with the Invariant Sections being list their titles , with
         the Front-Cover Texts being list , and with the Back-Cover Texts
         being list .
Jika Anda memiliki Bagian Invarian tanpa Teks Sampul, atau kombinasi lain di antara ketiganya, gabungkan kedua alternatif tersebut agar sesuai dengan situasi.
Jika dokumen Anda mengandung contoh trivial kode program, kami sarankan merilis contoh-contoh tersebut paralel dengan pilihan lisensi perangkat lunak bebas, seperti GNU General Public License, untuk mengizinkan penggunaannya dalam perangkat lunak bebas.

Previous: Copying This Manual , Up: Top

Indeks


Catatan kaki

[ 1 ] chain-load is the mechanism for loading unsupported operating systems by loading another boot loader. It is typically used for loading DOS or Windows.
[ 2 ] Only CRC32 data integrity check is supported (xz default is CRC64 so one should use –check=crc32 option). LZMA BCJ filters are supported.
[ 3 ] There are a few pathological cases where loading a very badly organized ELF kernel might take longer, but in practice this never happen.
[ 4 ] The LInux LOader, a boot loader that everybody uses, but nobody likes.
[ 5 ] El Torito is a specification for bootable CD using BIOS functions.
[ 6 ] Currently a backslash-newline pair within a variable name is not handled properly, so use this feature with some care.
[ 7 ] However, this behavior will be changed in the future version, in a user-invisible way. 

Source : [diterjemahkan secara bebas : "GOOGLE TRANSLATE" ]
http://www.gnu.org/software/grub/manual/grub.html

0 komentar:

Posting Komentar

.:Tutorial DHTML DLL:.

Tutorial tentang Dhtml scripts, Jquery plugins ,Javascript, CSS, CSS3, Html5 Library dll dan penerapannya pada Website, langsung aja kunjungi Website nya dan yang nggak kalah penting Free Yaa !!

.:distrowatch:.

Pengin Banyak tau tentang distro linux Langsung Aja Kunjungi DistroWatch Hmmm, banyak banget distronya, Download dan Pasang Linuxnya Lets Go Boss !!

.:jQuery Tutorial:.

Tutorial jQuery Widget ada disini semua Langsung Ke TKP Boss !!

.:Hirens Boot CD:.

Hiren's Boot CD cukup ampuh untuk membuat Clonning Atau Copy windows, dan banyak tool yang sangat berguna bagi para teknisi komputer maupun yang masih pemula silahkan Download filenya Disini kalo mau lihat tutorialnya membuat Flashdisc Bootable Disini Lumayan buat nambah ilmu dan Tool, Langsung aja Boss !!

Hiren’s BootCD

Bookmark and Share