rootflags 中文man頁面
NAME
rdev - 查詢/設置內核映像文件的根設備,RAM 磁盤大小或視頻模式
總覽 SYNOPSIS
rdev [ -rvh ] [ -o offset ] [ image [ value [ offset ] ] ] rdev [ -o offset ] [ image [ root_device [ offset ] ] ] ramsize [ -o offset ] [ image [ size [ offset ] ] ] vidmode [ -o offset ] [ image [ mode [ offset ] ] ] rootflags [ -o offset ] [ image [ flags [ offset ] ] ]
描述 DESCRIPTION
不帶任何參數的 rdev 命令將輸出當前根文件系統的 /etc/mtab 文件行。不帶任何參數的 ramsize, vidmode, 和 rootflags 將顯示幫助信息。
在一個 i386 上的 linux 可引導內核映像文件中,有幾對字節用來指定根設備,視頻模式和 RAM 磁盤的大小。這些字節對,在默認情況下起始在內核映像的偏移量504 (十進制) 處。
- 498 Root flags (根標志) (500 和 502 保留) 504 RAM Disk Size RAM (磁盤大小) 506 VGA Mode (VGA 模式) 508 Root Device (根設備) (510 Boot Signature (啟動標記))
rdev 可以改變這些值。
典型的 image 參數的值是一個可啟動的 linux 內核映像,可能是
- /vmlinux /vmunix /boot/bzImage-2.4.0 /dev/fd0 /dev/fd1
當使用 rdev 命令時, root_device 參數是類似如下所示的值:
- /dev/hda1 /dev/hdf13 /dev/sda2 /dev/sdc4 /dev/ida/c0d0p1
也可以通過使用一個逗號 (comma) 分隔的十進制整數對 major,minor 來指定這個設備。
對于 ramsize 命令, size 參數指定了 RAM 磁盤的大小,以千字節為單位。
對于 rootflags 命令, flags 參數包含在掛載 root 文件系統時額外的信息。當前這些標志的***作用是當 flags 非零時,強制內核以只讀模式來掛載 root 文件系統。
對于 vidmode 命令, mode 參數指定了視頻模式。
- -3 = Prompt (提示) -2 = Extended VGA (擴展的VGA) -1 = Normal VGA (普通VGA) 0 = as if "0" was pressed at the prompt (假設在提示時按下了"0") 1 = as if "1" was pressed at the prompt 2 = as if "2" was pressed at the prompt n = as if "n" was pressed at the prompt
如果沒有指定 value ,將檢測 image 來得到當前的設置。
選項 OPTIONS
- -r
- 使得 rdev 作為 ramsize 運行。
- -R
- 使得 rdev 作為 rootflags 運行。
- -v
- 使得 rdev 作為 vidmode 運行。
- -h
- 提供幫助。
BUGS
rdev 工具,如果不是用做查找當前根設備的名稱,那么就是一種古老的破解 (hack) ,依靠對內核的一個特定 (magic) 位移以特殊 (magic) 數字進行修改來工作。它在 i386 之外的體系中不能工作。不鼓勵使用它。使用一個啟動管理器,例如 SysLinux , LILO 或者 grub 來替代它。
歷史 HISTORY
偏移 502 從前是交換設備的設備號 (在 linux 0.12 中),運行 "rdev -s" 或者 "swapdev" 將設置它。但是,從 linux 0.95 起,這個常量不再使用,交換設備是以 swapon() 系統調用來指定的。
#p#
NAME
rdev - query/set image root device, RAM disk size, or video mode
SYNOPSIS
rdev [ -rvh ] [ -o offset ] [ image [ value [ offset ] ] ] rdev [ -o offset ] [ image [ root_device [ offset ] ] ] ramsize [ -o offset ] [ image [ size [ offset ] ] ] vidmode [ -o offset ] [ image [ mode [ offset ] ] ] rootflags [ -o offset ] [ image [ flags [ offset ] ] ]
DESCRIPTION
With no arguments, rdev outputs an /etc/mtab line for the current root file system. With no arguments, ramsize, vidmode, and rootflags print usage information.
In a bootable image for the Linux kernel on i386, there are several pairs of bytes which specify the root device, the video mode, and the size of the RAM disk. These pairs of bytes, by default, begin at offset 504 (decimal) in the kernel image:
- 498 Root flags (500 and 502 Reserved) 504 RAM Disk Size 506 VGA Mode 508 Root Device (510 Boot Signature)
rdev will change these values.
Typical values for the image parameter, which is a bootable Linux kernel image, might be:
- /vmlinux /vmunix /boot/bzImage-2.4.0 /dev/fd0 /dev/fd1
When using the rdev command, the root_device parameter might be something like:
- /dev/hda1 /dev/hdf13 /dev/sda2 /dev/sdc4 /dev/ida/c0d0p1
One may also specify the device by a comma-separated pair of decimal integers major,minor.
For the ramsize command, the size parameter specifies the size of the RAM disk in kilobytes. 2.0.x kernels and newer dynamically allocate the ramdisk and do not need this setting.
For the rootflags command, the flags parameter contains extra information used when mounting root. Currently the only effect of these flags is to force the kernel to mount the root filesystem in readonly mode if flags is non-zero.
For the vidmode command, the mode parameter specifies the video mode:
- -3 = Prompt -2 = Extended VGA -1 = Normal VGA 0 = as if "0" was pressed at the prompt 1 = as if "1" was pressed at the prompt 2 = as if "2" was pressed at the prompt n = as if "n" was pressed at the prompt
If the value is not specified, the image will be examined to determine the current settings.
OPTIONS
- -r
- Causes rdev to act like ramsize. (Not relevant for 2.0.x and newer kernels.)
- -R
- Causes rdev to act like rootflags.
- -v
- Causes rdev to act like vidmode.
- -h
- Provides help.
BUGS
The rdev utility, when used other than to find a name for the current root device, is an ancient hack that works by patching a kernel image at a magic offset with magic numbers. It does not work on architectures other than i386. Its use is strongly discouraged. Use a boot loader like SysLinux or LILO instead.
HISTORY
At offset 502 there used to be the device number of the swap device (in Linux 0.12), and "rdev -s" or "swapdev" would set this. However, since Linux 0.95 this constant is not used any longer, and the swap device is specified using the swapon() system call.