忍者ブログ

◆当blogは、Linuxサーバ構築する際の実際の設定手順を個人的メモとして記載しております。LinuC試験の役に立つ情報があるかも…?

LinuC(Linux技術者認定資格)&リナックスサーバ構築設定事例

   

【デバイス/ファイル】

[root@A]# cat /etc/fstab
/dev/VolGroup00/LogVol00 /                       ext3    defaults        1 1
/dev/VolGroup00/LogVol03 /tmp                    ext3    defaults        1 2
/dev/VolGroup00/LogVol02 /var                    ext3    defaults,usrquota,grpquota        1 2
LABEL=/boot             /boot                   ext3    defaults        1 2
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
/dev/VolGroup00/LogVol01 swap                    swap    defaults        0 0

[root@A]# cat /proc/filesystems
nodev   sysfs
nodev   rootfs
nodev   bdev
nodev   proc

[root@A]# cat /etc/mtab
/dev/mapper/VolGroup00-LogVol00 / ext3 rw 0 0
proc /proc proc rw 0 0
sysfs /sys sysfs rw 0 0

[root@A]# cat /proc/mounts
rootfs / rootfs rw 0 0
/dev/root / ext3 rw,data=ordered 0 0
/dev /dev tmpfs rw 0 0

[root@A]# mount
/dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)

[root@A]# sync

[root@A]# dd if=/dev/zero of=/tmp/swapfile bs=1M count=50
50+0 records in
50+0 records out
52428800 bytes (52 MB) copied, 0.117411 seconds, 447 MB/s

[root@A]# mkswap /tmp/swapfile
Setting up swapspace version 1, size = 52424 kB

[root@A]# swapon /tmp/swapfile

[root@A]# swapon -s
Filename                                Type            Size    Used    Priority
/dev/mapper/VolGroup00-LogVol01         partition       1048568 0       -1
/tmp/swapfile                           file            51192   0       -2

[root@A]# cat /proc/swaps
Filename                                Type            Size    Used    Priority
/dev/mapper/VolGroup00-LogVol01         partition       1048568 0       -1
/tmp/swapfile                           file            51192   0       -2

[root@A]# cdrecord -scanbus
Cdrecord-Clone 2.01 (cpu-pc-linux-gnu) Copyright (C) 1995-2004 Jg Schilling
Note: This version is an unofficial (modified) version with DVD support
Note: and therefore may have bugs that are not present in the original.
Note: Please send bug reports or support requests to http://bugzilla.redhat.com/bugzilla
Note: The author of cdrecord should not be bothered with problems in this version.
cdrecord: Invalid or incomplete multibyte or wide character. Cannot open SCSI driver.
cdrecord: For possible targets try 'cdrecord -scanbus'.
cdrecord: For possible transport specifiers try 'cdrecord dev=help'.

[root@A]# dumpe2fs /dev/sda1 | more
Inode count:              26104
Block count:              104388
Reserved block count:     5219
Free blocks:              89012
Free inodes:              26070
First block:              1
Block size:               1024
Group 1: (Blocks 8193-16384)
  Backup superblock at 8193, Group descriptors at 8194-8194

[root@A]# fsck.ext3
Emergency help:
 -p                   Automatic repair (no questions)
 -n                   Make no changes to the filesystem
 -y                   Assume "yes" to all questions
 -c                   Check for bad blocks and add them to the badblock list
 -f                   Force checking even if filesystem is marked clean
 -v                   Be verbose
 -b superblock        Use alternative superblock
 -B blocksize         Force blocksize when looking for superblock
 -j external_journal  Set location of the external journal
 -l bad_blocks_file   Add to badblocks list
 -L bad_blocks_file   Set badblocks list

[root@A]# e2fsck
Emergency help:
 -p                   Automatic repair (no questions)
 -n                   Make no changes to the filesystem
 -y                   Assume "yes" to all questions
 -c                   Check for bad blocks and add them to the badblock list
 -f                   Force checking even if filesystem is marked clean
 -v                   Be verbose
 -b superblock        Use alternative superblock
 -B blocksize         Force blocksize when looking for superblock
 -j external_journal  Set location of the external journal
 -l bad_blocks_file   Add to badblocks list
 -L bad_blocks_file   Set badblocks list

[root@A]# tune2fs -l /dev/sda1
Inode count:              26104
Block count:              104388
Reserved block count:     5219
Free blocks:              89012
Free inodes:              26070
First block:              1
Block size:               1024

[root@A]# badblocks /dev/sda1

[root@A]# debugfs /dev/sda1
debugfs 1.39 (29-May-2006)
debugfs:  ls
 2  (12) .    2  (12) ..    11  (20) lost+found    16065  (36) grub
 12  (16) message    17  (44) initrd-2.6.18-128.el5.img
 13  (36) System.map-2.6.18-128.el5    14  (32) config-2.6.18-128.el5
 15  (36) symvers-2.6.18-128.el5.gz    16  (780) vmlinuz-2.6.18-128.el5
debugfs:  quit

[root@A]# cat /etc/auto.master
/misc   /etc/auto.misc

[root@A]# /etc/init.d/autofs restart
automount を停止中:                                        [  OK  ]
automount を起動中:                                        [  OK  ]

[root@A]# ls -l /etc/auto.*
-rw-r--r-- 1 root root  717  1月 21  2009 /etc/auto.master
-rw-r--r-- 1 root root  581  1月 21  2009 /etc/auto.misc
-rwxr-xr-x 1 root root 1292  1月 21  2009 /etc/auto.net
-rwxr-xr-x 1 root root  715  1月 21  2009 /etc/auto.smb

[root@A]# cat /etc/auto.master
/misc   /etc/auto.misc

[root@A]# cat /etc/auto.misc
cd              -fstype=iso9660,ro,nosuid,nodev :/dev/cdrom

[root@A]# ls -l /dev/sda{,1,2}
brw-r----- 1 root disk 8, 0  1月  5 16:42 /dev/sda
brw-r----- 1 root disk 8, 1  1月  5 16:42 /dev/sda1
brw-r----- 1 root disk 8, 2  1月  5 16:42 /dev/sda2

[root@A]# ls -l /dev/{ttyS0,input/mice,lp0}
crw------- 1 root root 13, 63  1月  5 16:42 /dev/input/mice
crw-rw---- 1 root lp    6,  0  1月  5 16:42 /dev/lp0
crw-rw---- 1 root uucp  4, 64  1月  5 16:41 /dev/ttyS0

[root@A]# cat /proc/devices
Character devices:
  1 mem
  4 ttyS
  5 /dev/tty
  5 /dev/console
  6 lp
 10 misc
180 usb
189 usb_device

Block devices:
  1 ramdisk
  2 fd
  8 sd
  9 md

[root@A]# ls /etc/udev/rules.d
05-udev-early.rules  51-hotplug.rules  60-pcmcia.rules
61-uinput-stddev.rules  90-alsa.rules  95-pam-console.rules
40-multipath.rules   60-libsane.rules  60-raw.rules

[root@A]# cat /etc/udev/rules.d/50-udev.rules
KERNEL=="tty",                  NAME="%k", GROUP="tty", MODE="0666", OPTIONS="last_rule"

[root@A]# udevinfo -q path -n /dev/sda1
/block/sda/sda1

root@A]# udevinfo -q env -n /dev/sda1
ID_VENDOR=VMware,
ID_MODEL=VMware_Virtual_S
ID_REVISION=1.0

PR

COMMENT

Name
Title
Mail(非公開)
URL
Color
Emoji Vodafone絵文字 i-mode絵文字 Ezweb絵文字
Comment
Pass   コメント編集に必要です
 管理人のみ閲覧

Test, just a test

Hello. And Bye.

TRACKBACK

Trackback URL:

更新日付

03 2025/04 05
S M T W T F S
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30

RECOMMEND

プロフィール

HN:
Account
HP:
性別:
非公開
職業:
--- NODATA ---
趣味:
--- NODATA ---
自己紹介:
◆当blogは、Linuxサーバ構築する際の実際の設定手順を個人的メモとして記載しております。LinuC試験の役に立つ情報があるかも…?

リンク

<<【ストレージ】  | HOME |  【システム起動】>>
Copyright ©  -- LinuC(Linux技術者認定資格)&リナックスサーバ構築設定事例 --  All Rights Reserved
Design by CriCri / Photo by Melonenmann / powered by NINJA TOOLS / 忍者ブログ / [PR]