swapdev8
Query/set image root device, swap device, ram disk size, or video mode
Part of rdev(8).
Usage
rdev [-rsvh]
[-o
offset]
[image
[value
[offset]]]
rdev [-o
offset]
[image
[root_device
[offset]]]
swapdev [-o
offset]
[image
[swap_device
[offset]]]
ramsize [-o
offset]
[image
[size
[offset]]]
vidmode [-o
offset]
[image
[mode
[offset]]]
rootflags [-o
offset]
[image
[flags
[offset]]]
Overview
With no arguments, rdev outputs an /etc/mtab line for the current root file system. With no arguments, swapdev, ramsize, vidmode, and rootflags print usage information.
In a bootable image for the Linux kernel, there are several pairs of bytes which specify the root device, the video mode, the size of the RAM disk, and the swap device. 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, are as follows:
/vmlinux /vmlinux.test /vmunix /vmunix.test /dev/fd0 /dev/fd1
When using the rdev, or swapdev commands, the root_device or swap_device parameter are as follows:
/dev/hda[1-8] /dev/hdb[1-8] /dev/sda[1-8] /dev/sdb[1-8]
For the ramsize command, the size parameter specifies the size of the RAM disk in kilobytes.
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
-
-s -
Causes
rdevto act likeswapdev.
-
-r -
Causes
rdevto act likeramsize.
-
-R -
Causes
rdevto act likerootflags.
-
-v -
Causes
rdevto act likevidmode.
-
-h -
Provides help.