Use LEFT and RIGHT arrow keys to navigate between flashcards;
Use UP and DOWN arrow keys to flip the card;
H to show hint;
A reads text to speech;
131 Cards in this Set
- Front
- Back
IRQs
0 1 2 3 4 |
0 - System timer - Reserved for internal use.
1 - Keyboard - Reserved for keyboard use only. 2 - Cascade for IRQs 8–15 3 - Second RS-232 serial port (COM2: in Windows) - May also be shared by a fourth RS-232 serial port. 4 First RS-232 serial port (COM1: in Windows) - May also be shared by a third RS-232 serial port. |
|
IRQ
5 6 7 8 |
5 - Sound card or second parallel port (LPT2: in Windows)
6 - Floppy disk controller Reserved for the first floppy disk controller. 7 - First parallel port (LPT1: in Windows) 8 - Real-time clock Reserved for system clock use only. |
|
IRQ
8 9 10 11 |
8 Real-time clock Reserved for system clock use only.
9 Open interrupt 10 Open interrupt 11 Open interrupt |
|
IRQ
12 13 14 15 |
12 - PS/2 mouse
13 - Math coprocessor Reserved for internal use. 14 - Primary ATA controller - The controller for ATA devices such as hard drives; typically /dev/hda and /dev/hdb under Linux. 15 - Secondary ATA controller - The controller for more ATA devices; typically /dev/hdc and /dev/hdd under Linux. |
|
Once a Linux system is running, you can explore what IRQs are being used for various purposes by
|
examining the file /proc/interrupts
$ cat /proc/interrupts |
|
/proc info
|
/proc filesystem is a virtual filesystem—it doesn’t refer to actual files on a hard disk, but to kernel data that’s convenient to represent using a filesystem.
The files in /proc provide information about the hardware, running processes, and so on. Used by many utils |
|
/proc/interrupts file lists IRQs that are in use by Linux but ___
|
/proc/interrupts file lists IRQs that are in use by Linux, but Linux doesn’t begin using an IRQ until the relevant driver is loaded. This may not happen until you try to use the hardware. Thus, the /proc/interrupts list may not show all the interrupts that are configured on your system.
|
|
I/O Address
COM1 COM2 COM3 COM4 |
port irq i/o address
COM1 4 0x03f8 COM2 3 0x02f8 COM3 4 0x03e8 COM4 3 0x02e8 |
|
i/o adresses
LPT1 LPT2 A: B: |
port irq i/o address
LPT1 7 0x0378-0x037f LPT2 5 0x0278-0x027f A: 6 0x03f0-0x03f7 B: 6 0x0370-0x0377 |
|
What linux device corresponds to
COM1, COM2, COM3, COM4 LPT1, LPT2 A:, B: |
COM1,2,3,4 - /dev/ttyS0 - /dev/ttyS3
LPT1,2 - /dev/lp0 - /dev/lp1 A:/B: - /dev/fd0 - /dev/fd1 |
|
Once a Linux system is running, you can explore what I/O addresses are being used by examining the contents of what file
|
/proc/ioports file
$ cat /proc/ioports |
|
DMA (abbr + expl)
|
Direct memory addressing (DMA) is an alternative method of communication to I/O ports. Rather than have the CPU mediate the transfer of data between a device and memory, DMA permits the device to transfer data directly, without the CPU’s attention. The result can be lower CPU requirements for I/O activity, which can improve overall system performance.
|
|
DMA channels are in use on your system, examine the
|
/proc/dma file
$ cat /proc/dma 2: floppy 4: cascade |
|
CHS geometry
LBA |
cylinder/head/sector (CHS) geometry
logical block addressing |
|
sysfs virtual filesystem
|
sysfs virtual filesystem mounted at /sys, exports information about devices so that "user space" utilities can access the information
|
|
user space program
kernel space code |
is one that runs as an ordinary program, whether it runs as an ordinary user or as root
kernel space code - runs as part of the kernel, typically only kernel can communicate directly with hardware |
|
HAL Daemon (abbr + expl)
|
The Hardware Abstraction Layer (HAL) Daemon, or hald, is a user space program that runs at all times (that is, as a daemon) that provides other user space programs with information about available hardware
|
|
D-Bus
|
Desktop Bus (D-Bus) provides a further abstraction of hardware information access. Like hald, D-Bus runs as a daemon. D-Bus enables processes to communicate with each other as well as to register to be notified of events, both by other processes and by hardware (such as the availability of a new USB device).
|
|
udev
|
Linux creates device nodes as conventional files in the /dev directory tree.
existence of hotplug devices and various other issues have motivated the creation of udev: a virtual file system, mounter at /dev create dynamic device files as drivers are loaded and unloaded |
|
how can you configure udev virtual filesystem
|
you can configure udev through file in /etc/udev
|
|
setpci utility
|
use to directly query and adjust PCI devices' config
|
|
lspci system
|
lspci command is used for this purpose; it displays all information about the PCI busses on your system and all devices connected to those busses
|
|
Options for lspci
-v -n -nn |
-v Increases verbosity of output. This option may be doubled (-vv) or tripled (-vvv) to produce yet more output
-n Displays information in numeric codes rather than translating the codes to manufacturer and device names. -nn Displays both the manufacturer and device names and their associated numeric codes. |
|
Options for lspci
-x -b -t |
-x Displays the PCI configuration space for each device as a hexadecimal dump. This is an extremely advanced option. Tripling (-xxx) or quadrupling (-xxxx) this option displays information about more devices
-b Shows IRQ numbers and other data as seen by devices rather than as seen by the kernel. -t Displays a tree view depicting the relationship between devices |
|
Options for lspci
-s [[[[domain]:] bus]:][slot][.[func]] -d [vendor]:[device] -i file |
-s [[[[domain]:] bus]:][slot][.[func]] - Displays only devices that match the listed specification. This can be used to trim the results of the output
-d [vendor]:[device] - Shows data on the specified device. -i file - Uses the specified file to map vendor and device IDs to names. (The default is /usr/share/misc/pci.ids.) |
|
Options for lspci
-m -D -m --version |
-m - Dumps data in a machine-readable form, intended for use by scripts. A single -m uses a backward-compatible format, whereas doubling (-mm) uses a newer format
-D - Displays PCI domain numbers. These numbers normally aren’t displayed. -m - Performs a scan in bus-mapping mode, which can reveal devices hidden behind a misconfigured PCI bridge. This is an advanced option that can be used only by root. --version - Displays version information. |
|
kernel modules (aka kernel drivers)
|
Hardware in Linux is handled by kernel drivers, many of which come in the form of kernel modules. These are stand-alone driver files, typically stored in the /lib/modules directory tree, that can be loaded and unloaded to provide access to hardware. Typically, Linux loads the modules it needs when it boots, but you may need to load additional modules yourself
|
|
/lib/modules directory
|
kernel modules are typically stored in the /lib/modules directory
|
|
lsmod cmd
|
You can learn about the modules that are currently loaded on your system by using lsmod
|
|
Linux enables you to load kernel modules with two programs:
|
insmod
modprobe. |
|
insmod prog
modprobe prog |
insmod program inserts a single module into the kernel. This process requires you to have already loaded any modules on which the module you’re loading relies
modprobe program, by contrast, automatically loads any depended-on modules and so is generally the preferred way to do the job. |
|
What command loads the floppy.ko module, which you must specify by filename.
Modules have module names, too, which are usually the same as the filename but without the extension, as in floppy for the floppy.ko file. Unfortunately, <cmd in question> requires the full module name. |
# insmod /lib/modules/2.6.26/kernel/drivers/block/floppy.ko
|
|
modprobe options
-v -C filename -n |
-v or --verbose
tells modprobe to display extra information about its operations. Typically, this includes a summary of every insmod operation it performs -C filename since modprobe use a config file we can change it with this option -n or --dry-run causes modprobe to perform checks and all other operations except the actual module insertions. You might use this option in conjunction with -v to see what modprobe would do without loading the module. |
|
What config. file modprobe uses?
|
/etc/modprobe.conf.
You can change the file by passing a new file with the -C filename option, as in modprobe -C /etc/mymodprobe.conf floppy |
|
modprobe options
-r -f -l --show-depends |
-r or --remove
reverses modprobe’s usual effect; it causes the program to remove the specified module and any on which it depends -f or --force force the module loading even if the kernel version doesn’t match what the module expects -l or --list option list of available options whose names match the wildcard you specify. For instance, typing modprobe -l v* --show-depends shows all the modules on which the specified module depend |
|
lsmod program
rmmod command |
shows how much memory each module consumes
rnmod unload a kernel module # rmmod floppy |
|
rmmod options
-v -f -w |
-v or --verbose option causes rmmod to display some extra information about what it’s doing
-f or --force option forces module removal even if the module is marked as being in use. -w or --wait option causes rmmod to wait for the module to become unused, rather than return an error message, if the module is in use. Once the module is no longer being used |
|
lsusb utility
|
simple use of this program with no options reveals basic information about your USB devices:
$ lsusb Bus 003 Device 008: ID 0686:400e Minolta Co., Ltd Bus 003 Device 001: ID 0000:0000 |
|
lsusb utility options
-v -s [[bus]:][devnum] -d [vendor]:[product] |
-v option produces extended information about each product
-s [[bus]:][devnum] option restricts output to the specified bus and device number. -d [vendor]:[product] You can limit output to a particular vendor and product by using the -d [vendor]:[product] option. The vendor and product are the codes just after ID on each line of the basic lsusb output |
|
lsusb utility options
-D filename -t --version |
-D filename displays information about the device that’s accessible via filename, which should be a file in the /proc/bus/usb directory tree.
-t option displays the device list as a tree, so that you can more easily see what devices are connected to specific controllers. --version option displays the version of the lsusb utility and exits. |
|
This directory provides a low-level interface to USB devices (what directory)
|
/proc/bus/usb
|
|
usbmgr package
|
is a program that runs in the background to detect changes on the USB bus. When it detects
changes, it loads or unloads the kernel modules that are required to handle the devices. /etc/usbmgr to handle specific devices /etc/usbmgr/usbmgr.conf to control the overall configuration |
|
Hotplug package
relies on kernel support added with the 2.4.x kernel series. |
system uses files stored in /etc/hotplug to control the configuration of specific USB devices
/etc/hotplug/usb.usermap contains a database of USB device IDs and pointers to scripts /etc/hotplug/usb contains scripts that are run when devices are plugged/unpligged |
|
scsi naming system hard drivers
scsi naming system cd rom |
/dev/nstx
/dev/scdx |
|
Under Linux, primary and extended partitions are assigned numbers from
|
1 to 4
/dev/hda1 - first primary partition on the first PATA /dev/sdb3 - third primary partition on the second SCSI disk, respectively |
|
Logical partitions are assigned numbers from
|
up, as in /dev/hda5 or /dev/sdb5. These numbers are assigned sequentially, and numbers aren’t ordinarily skipped; if a disk has
/dev/hda6, then /dev/hda5 also exists. |
|
partition type codes
|
used mainly in x86
0x06 - FAT 0x82 - Linux swap partition 0x83 - Linux filesystem partition for the most part Linux ignores partition type codes, exception is during installation and extended partitons codes 0x05 and 0x06 |
|
cmd to examine the partition table on a disk
|
disk -l /dev/hdb
As root change hdb to an appropriate device identifier |
|
GNU Parted
|
To manipulate non-x86 partitions supports x86, Macintosh, and several other types of
partition tables. |
|
GPT system (abbr)
LVM |
Globally Unique Identifier (GUID) Partition Table (GPT) system
logical volume management alternative to partitions for some functions is logical volume management |
|
To use LVM, you set aside one or more partitions and assign them partition type codes of
What utilities can you use to manage LMV? then to access the logical volume using names assigned to them in what folder |
0x8e
pvcreate, vgcreate, lvcreate, and lvscan, /dev/mapper folder LMV enables you to easily resize your logical volumes without worrying about the position or size of surrounding partitions |
|
Linux, though, doesn’t use drive letters
|
instead, Linux uses a unified directory tree. Each partition is mounted at a mount point in that tree. A mount point is a directory that’s used as a way to access the filesystem on the partition, and mounting the filesystem is the process of linking the filesystem to the mount point
|
|
swap partition (mount point)
|
1.5–2 times system RAM size
Serves as an adjunct to system RAM; is slow, but enables the computer to run more or larger programs |
|
/home partition (mount point)
|
Holds users’ data files. Isolating it on a separate partition preserves user data during a system upgrade. Size depends on the number of users and their data storage needs.
|
|
/boot partition (mount point)
|
Holds critical boot files. Creating it as a separate partition lets you circumvent limitations of older BIOSs and boot loaders on hard disks over 8GB
|
|
/usr partition (mount point)
/usr/local partition (mount point) |
/usr - Holds most Linux program and data files
/usr/local - Holds Linux program and data files that areunique to this installation, particularly those that you compile yourself |
|
/opt partition (mount point)
|
Holds Linux program and data files that are associated with third-party packages, especially commercial ones.
|
|
fdisk
|
traditional Linux tool for disk partitioning
fdisk /dev/hda |
|
Display the current partition table
Display the help for fdisk Create a partition Delete a partition |
p (once fdisk is started)
m (once fdisk is started) n d |
|
fdisk -l /dev/hda
|
display current partition table without going in fdisk
|
|
What command to use in fdisk to change partition type?
|
t
when fdisk creates a partition it assigns a type of code t allows you to change the partition type of code |
|
fdisk list partition types
fdisk make a partition bootable fdisk quit fdisk commit ch agnes |
l
at the main fdisk prompt to see a list of the partition types a makes a partition bootable q quit w commits changes |
|
low-level format a floppy disk
|
you must use the fdformat command, as in fdformat /dev/fd0. This command cannot be used on a hard disk.
|
|
Ext2fs
|
Ext2fs - Second Extended File System (ext2fs or ext2)
traditional Linux native filesystem good choice for small boot partition non-journaling type code ext2 |
|
Ext3fs
|
Ext3fs - third extended file system (ext3fs or ext3)
Ext2fs with a journal added which allows it to recover from power outages type code ext3 |
|
Ext4fs
|
Ext4fs - Fourth Extended File System
adds ability to work with large files up to 32tb type code ext4de/ext4 |
|
ReiserFS
|
designed as a journaling filesystem for Linux
good for handling filesystems with a lot of small files type code - reiserfs |
|
JFS
|
Journaled File System by IBM for OS/2
technically sophisticated journaling filesystem type code - jfs |
|
XFS
|
Extents File System (XFS)
robust, fast and flexible but since it was designed for IRIX OS soem features are not fully supported on Linux type code xfs |
|
FAT
|
File Allocation Table (FAT)
linux automatically detects the FAT size type code msdos type code to support long windows names vfat |
|
NTFS
|
New Technology File System (NTFS)
Linux support for NTFS is rudimentary, as of 2.6.x kernel, linux cat read NTFS and can overwrite existing files, but Linux kernel can't write new files |
|
NTFS-3G driver
|
This is a read/write NTFS driver that resides in user space rather than in kernel space. It’s used as the default NTFS driver by some Linux distributions.
|
|
HFS and HFS+
|
Hierarchical File System (HFS) by Apple
Linux fully support HFS |
|
ISO-9660
|
standard filesystem for CD-ROMs
Level 1 is similar to the original FAT - supports only 8.3 filenames Levels 2 and 3 add support for longer 32-character filenames type code iso9660 |
|
Rock Ridge extensions
|
are a series of extensions to ISO-9660 to enable it to support Unix-style long filenames, permissions, symbolic links, and so on. If a
disc includes Rock Ridge extensions, Linux will automatically detect and use them |
|
Joliet
|
much like Rock Ridge, as an extension to ISO-9660, but it’s technically a separate filesystem
Linux supports Joliet as part of its iso9660 driver; if a disc contains Joliet but not Rock Ridge, Linux uses the Joliet filesystem. |
|
UDF
|
Universal Disc Format (UDF)
next-generation filesystem for optical discs used on DVD-ROM |
|
Creating a Filesystem cmd
|
# mkfs -t ext3 /dev/hda6
|
|
Creating a Filesystem for ext2 and ext3 filesystems cmd
-m option |
mke2fs
-m percent, which sets the reserved-space percentage. -m 0 also makes sense on removable disks ext2fs/ext3fs reserved-space percentage defaults to 5 percent |
|
tool for creating FAT systems
-F fat-size option |
mkdosfs, but it’s often linked to the mkfs.msdos and mkfs.vfat names,
-F fat-size option set size of the FAT to 12, 16 or 32 |
|
swap partition
|
Linux treats as an extension of memory
type code 0x82 |
|
What file linux uses to define which partitions to use as swap space
|
/etc/fstab
|
|
mkswap command
|
mkswap /dev/hda7
swap space does require preparation similar to that for creation of a filesystem this task is accomplisehd with the mkswap cmd |
|
use the swap space, you must activate it with the ???? cmd
|
# swapon /dev/hda7
To permanently activate swap space, you must create an entry for it in /etc/fstab |
|
Obtaining Filesystem Information cmd
|
dumpe2fs
gets info about ext2 and ext3 dumpe2fs [options] device |
|
Obtaining Filesystem Information cmd
(for xfs) |
xfs_info
# xfs_info /dev/sda7 Most other filesystems lack an equivalent to dumpe2fs, but XFS provides something with at least some surface similarities: xfs_info |
|
xfs_metadump
|
program copies the filesystem’s metadata to a file
xfs_metadump /dev/sda7 ~/dump-file copies the metadata to ~/dump-file, this is not a backup |
|
tune2fs program
|
enables you to change many of the filesystem parameters that are
reported by dumpe2fs. tune2fs [options] device |
|
tune2fs option
-c mounts -i interval |
-c mounts option
ext2fs and ext3fs require a periodic disc check fsck, whit this option you adjust the max number of time the disk may be mounted without a check -i interval Periodic disk checks are required based on time as well, with this option we set the interval between checks |
|
tune2fs option
-j option -m percent |
-j option
journal to the filesystem, effectively converting an ext2 filesystem into an ext3 filesystem -m percent sets the percentage of disk space that’s reserved for use by root |
|
xfs_admin command
|
rough equivalent of tune2fs
|
|
xfs_admin option
-j option -l and -u options -L label or -U uuid option |
-j option
enables version 2 log (journal) format, which can improve performance in some situations. -l and -u options obtain the filesystem’s label (name) and universally unique identifier (UUID), respectively -L label or -U uuid option You can change the filesystem’s label or UUID |
|
sets the name of the filesystem on /dev/sda7 to av_data
|
# xfs_admin -L av_data /dev/sda7
writing all SBs new label = “av_data” |
|
debugfs.
|
In addition to reviewing and changing filesystem flags with dumpe2fs and tune2fs, you can interactively modify a filesystem’s features using debugfs. This program provides the abilities of dumpe2fs, tune2fs, and many of Linux’s normal file-manipulation tools all rolled into one
# debugfs /dev/hda11 debugfs: |
|
debugfs option
show_super_stats stat filename, |
show_super_stats or stats
produces superblock information, similar to what dumpe2fs displays. stat filename display the inode data on a file or directory |
|
debugfs option
undelete inode name lsdel |
undelete inode name
undelete a file, where inode is the inode number of the deleted file and name is the filename you want to give to it. lsdel or list_deleted_inodes list of deleted inodes |
|
debugfs option
write internalfile external-file list_requests, lr, help, or ? quit |
write internalfile external-file
extract a file from the filesystem, where internal-file is the name of a file in the filesystem you’re manipulating and external-file is a filename on your main Linux system list_requests, lr, help, or ? produces a summary of available commands quit exits from the program |
|
xfs_db cmd
|
closest XFS equivalent to debugfs is called xfs_db.
|
|
fsck
|
tool for verifying a filesystem's integrity and for correcting any problems that may exist
fsck [-sACVRTNP] [-t fstype] [--] [fsck-options] filesystems |
|
fsck options
-A -C -V |
-A option causes fsck to check all the filesystems marked to be checked in /etc/fstab.
-C option displays a text-mode progress indicator of the check process. -V option produces verbose output of the check process |
|
fsck options
-t fstype -N |
Normally, fsck determines the filesystem type automatically. You can force the type with the -t fstype flag, though
-N option tells fsck to display what it would normally do without actually doing it |
|
fsck command passes options it doesn’t understand, or those that follow a double dash (--), to the underlying check program. Common options:
-a -p -r -f |
-a or -p
perform automatic check -r perform an interactive check -f force a full filesystem check even if the filesystem initially appears to be clean |
|
df command
|
df displays the amount of disk space available on the filesystem containing each file name argumen
df [options] [files] $ df Filesystem 1K-blocks Used Available Use% Mounted on /dev/sdb10 5859784 4449900 1409884 76% / /dev/sdb12 2086264 991468 1094796 48% /opt |
|
df option
-a -h -H -k/-m |
-a or --all option
includes pseudo filesystems with a size of 0 in the output. These filesystems may include /proc, /sys, /proc/bus/usb, and others. -h or --human-readable option causes df to scale and label its units; for instance, instead of reporting a partition as having 5859784 blocks, it reports the size as 5.6G (for 5.6GB). -H and --si options causes df to scale and label its units, but they use power-of-10 -k (--kilobytes) and -m (--megabytes) options force output in their respective units. |
|
df option
-i -l -T -t |
-i or --inodes option
By default, df summarizes available and used disk space. You can instead receive a report on available and used inodes -l or --local option causes df to omit network filesystems. This can speed up operation -T or --print-type option adds the filesystem type to the information df displays |
|
df option
-t fstype -x fstype |
-t fstype or --type=fstype option
displays only information about filesystems of the specified type -x fstype or --exclude-type=fstype excludes filesystems of the specified type from the report |
|
du cmd
|
shows disk usage by individual directories and files
du [options] [directories] |
|
du option
-a -c -h |
-a or --all option
Ordinarily, du reports on the space used by the files in directories but not the space used by individual files, this option causes du to report on individual files as well -c or --total option causes du to add a grand total to the end of its output -h or --human-readable causes du to scale and label its units -H and --si options have a similar effect but they use powerof-10 -k (--kilobytes) and -m (--megabytes) options force output in their respective units |
|
du option
-l --max-depth=n -s -x |
-l or --count-links option
Ordinarily, du counts files that appear multiple times as hard links only once. This reflects true disk space used, but sometimes you may want to count each link independently --max-depth=n option limits the report to n levels -s or --summarize option If you don’t want a line of output for each subdirectory in the tree which limits the report to those files and directories you specify on the command line -x or --one-file-system option limits the report to the current filesystem. If another filesystem is mounted within the tree you want summarized, its contents aren’t included in the report. |
|
Cmd to discover which of your users is consuming the most disk space in /home.
|
# du -s /home/*
12 /home/ellen 35304 /home/freddie 1760 /home/jennie 12078 /home/jjones 0 /home/lost+found 10110324 /home/mspiggy |
|
persistently mount across reboots by editing
|
/etc/fstab file
|
|
mount syntax
|
[-alrsvw] [-t fstype] [-o options] [device] [mountpoint]
|
|
mount options
-a -r -v |
-a parameter causes mount to mount all the filesystems listed in the /etc/fstab file
-r parameter causes Linux to mount the filesystem read-only, even if it’s normally a read/write filesystem. -v produces verbose output—the program provides comments on operations as they occur. |
|
mount options
-w -t fstype -L label and -U uuid options |
-w parameter causes Linux to attempt to mount the filesystem for both read and write operations.
-t fstype parameter to specify the filesystem type -L label and -U uuid options tell mount to mount the filesystem with the specified label or UUID, respectively. |
|
mount options
device mountpoint |
device is the device filename associated with the partition or disk device, such as /dev/hda4, /dev/fd0, or /dev/cdrom
mountpoint is the directory to which the device’s contents should be attached. |
|
command mounts the contents of /dev/sdb7 on /mnt/shared, auto-detecting the filesystem type and using the default options
|
# mount /dev/sdb7 /mnt/shared
|
|
only root may issue a mount command; however, if ______ specifies the user, users, or owner option, an ordinary user may mount a filesystem using a simplified syntax in which only the device or mount point is specified, but not both.
|
if /etc/fstab specifies the user, users, or owner option, an ordinary user may mount a filesystem using a simplified syntax in which only the device or mount point is specified, but not both
|
|
what cmd to type to mount a CD-ROM if /etc/fstab specifies /mnt/cdrom as its mount point and uses the user, users, or owner option
|
mount /mnt/cdrom
|
|
mount options
defaults loop |
defaults - All - Causes the default options for this filesystem to be used. It’s used primarily in the /etc/ fstab file to ensure that the file includes an options column.
loop - All - Causes the loopback device for this mount to be used. Allows you to mount a file as if it were a disk partition. For instance, mount -t vfat -o loop image.img /mnt/image mounts the file image.img as if it were a disk. |
|
mount options
auto or noauto user or nouser users |
auto or noauto - All - Mounts or doesn’t mount the filesystem at boot time or when root issues the mount -a command. The default is auto, but noauto is appropriate for removable media. Used in /etc/fstab.
user or nouser - All - Allows or disallows ordinary users to mount the filesystem. The default is nouser users - All - Similar to user, except that any user may unmount a filesystem once it’s been mounted. |
|
mount options
owner remount ro |
owner - All - Similar to user, except that the user must own the device file. Some distributions, such as Red Hat, assign ownership of some device files (such as /dev/fd0 for the floppy disk) to the console user, so this can be a helpful option
remount - All - Changes one or more mount options without explicitly unmounting a partition. To use this option, you issue a mount command on an already-mounted filesystem but with remount along with any options you want to change. This feature can be used to enable or disable write access to a partition, for example ro - All - Specifies a read-only mount of the filesystem. This is the default for filesystems that include no write access and for some with particularly unreliable write support. |
|
mount options
rw uid=value gid=value |
rw - All read/write filesystems - Specifies a read/write mount of the filesystem.
This is the default for most read/write filesystems. uid=value - - Sets the owner of all files. For instance, uid=500 sets the owner to whoever has Linux user ID 500. gid=value - - Works like uid=value, but sets the group of all files on the filesystem. You can find group IDs in the /etc/group file. |
|
mount options
umask=value dmask=value fmask=value |
umask=value
Sets the umask for the permissions on files. value is interpreted in binary as bits to be removed from permissions on files. dmask=value Similar to umask, but sets the umask for directories only, not for files. fmask=value Similar to umask, but sets the umask for files only, not for directories. |
|
mount options
conv=code norock |
conv=code - If code is b or binary, Linux doesn’t modify the files’ contents. If code is t or text, Linux auto-converts files between Linux-style and DOS- or Macintosh-style end-of-line characters. If code is a or auto, Linux applies the conversion unless the file is a known binary file format. It’s usually best to leave this at its default value of binary because file conversions can cause serious problems for some applications and file types.
norock - iso9660 - Disables Rock Ridge extensions for ISO-9660 CD-ROMs. nojoliet - iso9660 - Disables Joliet extensions for ISO-9660 CD-ROMs. |
|
umount cmd
|
umount [-afnrv] [-t fstype] [device | mountpoint]
|
|
umount option
-a -f -r |
-a option
causes the system to attempt to unmount all the partitions listed in /etc/mtab -f option tell Linux to force an unmount operation that might otherwise fail. -r option tells umount that if it can’t unmount a filesystem, it should attempt to remount it in read-only mode. |
|
umount option
-t fstype device |
-t fstype option
tells the system to unmount only partitions of the specified type. You can list multiple filesystem types by separating them with commas. device You need to specify only the device or only the mountpoint, not both |
|
What file controls how Linux provides access to disk partitions and removable media devices.
|
/etc/fstab
/etc/fstab file consists of a series of lines that contain six fields each; the fields are separated by one or more spaces or tabs |
|
Sample /etc/fstab File
|
#device mount point filesystem options dump fsck
/dev/hda1 / ext3 defaults 1 1 UUID=3631a288-673e-40f5-9e96-6539fec468e9 \ /usr reiserfs defaults 0 0 LABEL=/home /home reiserfs defaults 0 0 /dev/hdb5 /windows vfat uid=500,umask=0 0 0 /dev/hdc /media/cdrom iso9660 users,noauto 0 0 /dev/sda1 /media/pen auto users,noauto 0 0 server:/home /other/home nfs users,exec 0 0 //winsrv/shr /other/win cifs users,credentials=/etc/creds 0 0 /dev/hda4 swap swap defaults 0 0 |
|
Mount point (Def)
|
second column specifies the mount point; in the unified Linux filesystem,
this is where the partition or disk will be mounted. This should usually be an empty directory in another filesystem. The root (/) filesystem is an exception. So is swap space, which is indicated by an entry of swap |
|
most important Linux disk partition is
home directories program files transient system files temporary user files kernel and boot files |
root (/) partition
/home /prog /var /temp /boot |