/l3/users/eb/2009/linux3/user :1 :2 :3 :4 :5 :6 :7 :8 :9 :10 :11 :12 :13 :14 :15 |
|
#apt-cache search fuse | grep mai
gmailfs - Use your GMail account as a filesystem |
#apt-get install e2tools
Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: portmap Use 'apt-get autoremove' to remove them. The following NEW packages will be installed: e2tools 0 upgraded, 1 newly installed, 0 to remove and 20 not upgraded. Need to get 31.9kB of archives. After this operation, 135kB of additional disk space will be used. Get:1 http://127.0.0.1 sid/main e2tools 0.0.16-4 [31.9kB] Fetched 31.9kB in 0s (236kB/s) Selecting previously deselected package e2tools. (Reading database ... 54624 files and directories currently installed.) Unpacking e2tools (from .../e2tools_0.0.16-4_i386.deb) ... Processing triggers for man-db ... Setting up e2tools (0.0.16-4) ... |
#ls -l /dev/sda1
brw-rw---- 1 root disk 8, 1 2009-05-30 09:24 /dev/sda1 |
#mknod /tmp/sda1 c 8 1
|
#ls -l /tmp/sda1
crw-r--r-- 1 root root 8, 1 2009-05-30 10:57 /tmp/sda1 |
#e2ls /tmp/sda1
No such device or address |
#chmod 444 /tmp/sda1
|
#e2ls /dev/sda1
^C |
#mount
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755) proc on /proc type proc (rw,noexec,nosuid,nodev) sysfs on /sys type sysfs (rw,noexec,nosuid,nodev) procbususb on /proc/bus/usb type usbfs (rw) udev on /dev type tmpfs (rw,mode=0755) tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev) devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620) rootfs on / type rootfs (rw) |
#mount /tmp/sda1 -o ro /mnt
mount: /tmp/sda1 is not a block device |
#rm /tmp/sda1
|
#!rm
rm /tmp/sda1 |
#apt-get install aetools
Reading package lists... Done Building dependency tree Reading state information... Done E: Couldn't find package aetools |
#apt-get install aoetools
Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: portmap Use 'apt-get autoremove' to remove them. The following NEW packages will be installed: aoetools 0 upgraded, 1 newly installed, 0 to remove and 20 not upgraded. Need to get 32.4kB of archives. After this operation, 160kB of additional disk space will be used. Get:1 http://127.0.0.1 sid/main aoetools 26-1 [32.4kB] Fetched 32.4kB in 0s (458kB/s) Selecting previously deselected package aoetools. (Reading database ... 54645 files and directories currently installed.) Unpacking aoetools (from .../aoetools_26-1_i386.deb) ... Processing triggers for man-db ... Setting up aoetools (26-1) ... Starting AoE devices discovery and mounting AoE filesystems: not started. |
#modprobe aoe
|
#aoe-stat
e1.1 20.003GB eth0 up |
#e2ls /dev/etherd/e
e1.1 err |
#e2ls /dev/etherd/e
e1.1 err |
#e2ls /dev/etherd/e1.1
bin boot deb dev etc home initrd.img lib lost+found media mnt opt proc root sbin selinux srv sys tmp tmp2 usr var vmlinuz |
#ls /
bin dev home lib media opt root selinux sys usr vmlinuz boot etc initrd.img lost+found mnt proc sbin srv tmp var |
#ls /tmp/
keyring-i2dym9 orbit-user ssh-VMQTDg3433 |
#mount
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755) proc on /proc type proc (rw,noexec,nosuid,nodev) sysfs on /sys type sysfs (rw,noexec,nosuid,nodev) procbususb on /proc/bus/usb type usbfs (rw) udev on /dev type tmpfs (rw,mode=0755) tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev) devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620) rootfs on / type rootfs (rw) |
#echo ';' | sfdisk /dev/sdb
Checking that no-one is using this disk right now ... OK Disk /dev/sdb: 38913 cylinders, 255 heads, 63 sectors/track Old situation: Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0 Device Boot Start End #cyls #blocks Id System /dev/sdb1 * 0+ 38912 38913- 312568641 7 HPFS/NTFS /dev/sdb2 0 - 0 0 0 Empty /dev/sdb3 0 - 0 0 0 Empty /dev/sdb4 0 - 0 0 0 Empty ... /dev/sdb2 0 - 0 0 0 Empty /dev/sdb3 0 - 0 0 0 Empty /dev/sdb4 0 - 0 0 0 Empty Warning: no primary partition is marked bootable (active) This does not matter for LILO, but the DOS MBR will not boot this disk. Successfully wrote the new partition table Re-reading the partition table ... If you created or changed a DOS partition, /dev/foo7, say, then use dd(1) to zero the first 512 bytes: dd if=/dev/zero of=/dev/foo7 bs=512 count=1 (See fdisk(8).) |
#fdisk -l /dev/sdb
Disk /dev/sdb: 320.0 GB, 320072933376 bytes 255 heads, 63 sectors/track, 38913 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0xce5cf3c1 Device Boot Start End Blocks Id System /dev/sdb1 1 38913 312568672 83 Linux |
#fdisk /dev/sdb
9 AIX bootable 4f QNX4.x 3rd part 8e Linux LVM df BootIt a OS/2 Boot Manag 50 OnTrack DM 93 Amoeba e1 DOS access b W95 FAT32 51 OnTrack DM6 Aux 94 Amoeba BBT e3 DOS R/O c W95 FAT32 (LBA) 52 CP/M 9f BSD/OS e4 SpeedStor e W95 FAT16 (LBA) 53 OnTrack DM6 Aux a0 IBM Thinkpad hi eb BeOS fs f W95 Ext'd (LBA) 54 OnTrackDM6 a5 FreeBSD ee EFI GPT 10 OPUS 55 EZ-Drive a6 OpenBSD ef EFI (FAT-12/16/ 11 Hidden FAT12 56 Golden Bow a7 NeXTSTEP f0 Linux/PA-RISC b 12 Compaq diagnost 5c Priam Edisk a8 Darwin UFS f1 SpeedStor 14 Hidden FAT16 <3 61 SpeedStor a9 NetBSD f4 SpeedStor ... s create a new empty Sun disklabel t change a partition's system id u change display/entry units v verify the partition table w write table to disk and exit x extra functionality (experts only) Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks. |
#fdisk /dev/sdb
Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0xce5cf3c1 Device Boot Start End Blocks Id System /dev/sdb1 * 1 1 0 0 Empty Partition 1 does not end on cylinder boundary. Command (m for help): n Command action e extended p primary partition (1-4) p ... s create a new empty Sun disklabel t change a partition's system id u change display/entry units v verify the partition table w write table to disk and exit x extra functionality (experts only) Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks. |
#fdisk -l /dev/sdb
Disk /dev/sdb: 320.0 GB, 320072933376 bytes 255 heads, 63 sectors/track, 38913 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0xce5cf3c1 Device Boot Start End Blocks Id System /dev/sdb1 1 1246 10008463+ 83 Linux /dev/sdb2 1247 2463 9775552+ 83 Linux /dev/sdb3 2464 4896 19543072+ 5 Extended /dev/sdb5 2464 3680 9775521 83 Linux /dev/sdb6 3681 4896 9767488+ 83 Linux |
#echo ';' | sfdisk /dev/sdb
Checking that no-one is using this disk right now ... OK Disk /dev/sdb: 38913 cylinders, 255 heads, 63 sectors/track Old situation: Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0 Device Boot Start End #cyls #blocks Id System /dev/sdb1 0+ 1245 1246- 10008463+ 83 Linux /dev/sdb2 1246 2462 1217 9775552+ 83 Linux /dev/sdb3 2463 4895 2433 19543072+ 5 Extended /dev/sdb4 0 - 0 0 0 Empty ... /dev/sdb2 0 - 0 0 0 Empty /dev/sdb3 0 - 0 0 0 Empty /dev/sdb4 0 - 0 0 0 Empty Warning: no primary partition is marked bootable (active) This does not matter for LILO, but the DOS MBR will not boot this disk. Successfully wrote the new partition table Re-reading the partition table ... If you created or changed a DOS partition, /dev/foo7, say, then use dd(1) to zero the first 512 bytes: dd if=/dev/zero of=/dev/foo7 bs=512 count=1 (See fdisk(8).) |
#!f
fdisk -l /dev/sdb Disk /dev/sdb: 320.0 GB, 320072933376 bytes 255 heads, 63 sectors/track, 38913 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0xce5cf3c1 Device Boot Start End Blocks Id System /dev/sdb1 1 38913 312568672 83 Linux |
#ls /dev/sdb*
/dev/sdb /dev/sdb1 |
#fdisk /dev/sdb
The number of cylinders for this disk is set to 38913. There is nothing wrong with that, but this is larger than 1024, and could in certain setups cause problems with: 1) software that runs at boot time (e.g., old versions of LILO) 2) booting and partitioning software from other OSs (e.g., DOS FDISK, OS/2 FDISK) Command (m for help): n Command action e extended p primary partition (1-4) ... Device Boot Start End Blocks Id System /dev/sdb1 1 1217 9775521 83 Linux /dev/sdb2 1218 2434 9775552+ 83 Linux /dev/sdb3 2435 4867 19543072+ 5 Extended /dev/sdb5 2435 3651 9775521 83 Linux /dev/sdb6 3652 4867 9767488+ 83 Linux Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks. |
#ls -l /dev/sdb*
brw-rw---- 1 root disk 8, 16 2009-05-30 11:54 /dev/sdb brw-rw---- 1 root disk 8, 17 2009-05-30 11:54 /dev/sdb1 brw-rw---- 1 root disk 8, 18 2009-05-30 11:54 /dev/sdb2 brw-rw---- 1 root disk 8, 19 2009-05-30 11:54 /dev/sdb3 brw-rw---- 1 root disk 8, 21 2009-05-30 11:54 /dev/sdb5 brw-rw---- 1 root disk 8, 22 2009-05-30 11:54 /dev/sdb6 |
#apt-get install parted
Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: portmap Use 'apt-get autoremove' to remove them. The following extra packages will be installed: libparted1.8-10 Suggested packages: libparted1.8-dev libparted1.8-i18n parted-doc ... Get:2 http://127.0.0.1 sid/main parted 1.8.8.git.2008.03.24-11.1 [64.5kB] Fetched 262kB in 0s (1766kB/s) Selecting previously deselected package libparted1.8-10. (Reading database ... 54675 files and directories currently installed.) Unpacking libparted1.8-10 (from .../libparted1.8-10_1.8.8.git.2008.03.24-11.1_i386.deb) ... Selecting previously deselected package parted. Unpacking parted (from .../parted_1.8.8.git.2008.03.24-11.1_i386.deb) ... Processing triggers for man-db ... Setting up libparted1.8-10 (1.8.8.git.2008.03.24-11.1) ... Setting up parted (1.8.8.git.2008.03.24-11.1) ... |
#dpkg -L parted
/. /usr /usr/share /usr/share/man /usr/share/man/man8 /usr/share/man/man8/parted.8.gz /usr/share/man/man8/partprobe.8.gz /usr/share/doc /usr/share/doc/parted /usr/share/doc/parted/changelog.Debian.gz /usr/share/doc/parted/copyright /usr/share/doc/parted/README.Debian /sbin /sbin/parted /sbin/partprobe |
#partprobe --help
Usage: partprobe [OPTION] [DEVICE]... Inform the operating system about partition table changes. -d, --dry-run do not actually inform the operating system -s, --summary print a summary of contents -h, --help display this help and exit -v, --version output version information and exit When no DEVICE is given, probe all partitions. Report bugs to <bug-parted@gnu.org>. |
#partprobe -s
/dev/sda: msdos partitions 1 /dev/sdb: msdos partitions 1 2 3 <5 6> |
#cfdisk /dev/sdb
|
#fdisk -l /dev/sdb
Disk /dev/sdb: 320.0 GB, 320072933376 bytes 255 heads, 63 sectors/track, 38913 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0xce5cf3c1 Device Boot Start End Blocks Id System /dev/sdb1 1 1217 9775521 83 Linux /dev/sdb2 1218 2434 9775552+ 83 Linux /dev/sdb3 2435 38913 293017567+ 5 Extended /dev/sdb5 2435 3651 9775521 83 Linux /dev/sdb6 3652 4867 9767488+ 83 Linux /dev/sdb7 4868 38913 273474463+ 83 Linux |
#mkfs.ext3 /dev/sdb1
mke2fs 1.41.5 (23-Apr-2009) Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) 612000 inodes, 2443880 blocks 122194 blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks=2503999488 75 block groups 32768 blocks per group, 32768 fragments per group 8160 inodes per group Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632 Writing inode tables: done Creating journal (32768 blocks): done Writing superblocks and filesystem accounting information: done This filesystem will be automatically checked every 39 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override. |
#e2label --help
e2label: No such file or directory while trying to open --help Couldn't find valid filesystem superblock. |
#man e2label
|
#e2label /dev/sdb1 TEST_VOL
|
#vol_id /dev/sdb1
ID_FS_USAGE=filesystem ID_FS_TYPE=ext3 ID_FS_VERSION=1.0 ID_FS_UUID=92fa5614-853a-45e5-b807-87301a35ab90 ID_FS_UUID_ENC=92fa5614-853a-45e5-b807-87301a35ab90 ID_FS_LABEL=TEST_VOL ID_FS_LABEL_ENC=TEST_VOL |
#blkid /dev/sdb1
/dev/sdb1: LABEL="TEST_VOL" UUID="92fa5614-853a-45e5-b807-87301a35ab90" SEC_TYPE="ext2" TYPE="ext3" |
#mount -L TEST_VOL /mnt
|
#mount
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755) proc on /proc type proc (rw,noexec,nosuid,nodev) sysfs on /sys type sysfs (rw,noexec,nosuid,nodev) procbususb on /proc/bus/usb type usbfs (rw) udev on /dev type tmpfs (rw,mode=0755) tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev) devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620) rootfs on / type rootfs (rw) /dev/sdb1 on /mnt type ext3 (rw) |
#umount /mnt
|
#tune2fs --help
tune2fs 1.41.5 (23-Apr-2009) tune2fs: invalid option -- '-' Usage: tune2fs [-c max_mounts_count] [-e errors_behavior] [-g group] [-i interval[d|m|w]] [-j] [-J journal_options] [-l] [-m reserved_blocks_percent] [-o [^]mount_options[,...]] [-r reserved_blocks_count] [-u user] [-C mount_count] [-L volume_label] [-M last_mounted_dir] [-O [^]feature[,...]] [-E extended-option[,...]] [-T last_check_time] [-U UUID] [ -I new_inode_size ] device |
#mount
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755) proc on /proc type proc (rw,noexec,nosuid,nodev) sysfs on /sys type sysfs (rw,noexec,nosuid,nodev) procbususb on /proc/bus/usb type usbfs (rw) udev on /dev type tmpfs (rw,mode=0755) tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev) devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620) rootfs on / type rootfs (rw) |
#ls -l /
total 72 drwxr-xr-x 2 root root 4096 2009-05-25 03:02 bin drwxr-xr-x 3 root root 4096 2009-05-25 03:04 boot drwxr-xr-x 15 root root 3700 2009-05-30 12:00 dev drwxr-xr-x 86 root root 4096 2009-05-30 12:14 etc drwxr-xr-x 3 root root 4096 2009-05-25 01:07 home lrwxrwxrwx 1 root root 28 2002-01-01 00:39 initrd.img -> boot/initrd.img-2.6.29-2-686 drwxr-xr-x 13 root root 12288 2009-05-30 11:56 lib drwx------ 2 root root 4096 2009-05-24 21:51 lost+found drwxr-xr-x 2 root root 4096 2009-05-30 11:38 media ... dr-xr-xr-x 114 root root 0 2009-05-30 09:24 proc drwxr-xr-x 6 root root 4096 2009-05-30 10:30 root drwxr-xr-x 2 root root 4096 2009-05-30 11:56 sbin drwxr-xr-x 2 root root 4096 2009-02-21 16:55 selinux drwxr-xr-x 2 root root 4096 2009-05-24 13:15 srv drwxr-xr-x 12 root root 0 2009-05-30 09:24 sys drwxrwxrwt 7 root root 4096 2009-05-30 11:02 tmp drwxr-xr-x 11 root root 4096 2009-05-24 13:22 usr drwxr-xr-x 13 root root 4096 2009-05-24 13:15 var lrwxrwxrwx 1 root root 25 2002-01-01 00:39 vmlinuz -> boot/vmlinuz-2.6.29-2-686 |
#mkdir /root/mnt1
|
#mount -L TEST_VOL /root/mnt1
|
#mount
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755) proc on /proc type proc (rw,noexec,nosuid,nodev) sysfs on /sys type sysfs (rw,noexec,nosuid,nodev) procbususb on /proc/bus/usb type usbfs (rw) udev on /dev type tmpfs (rw,mode=0755) tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev) devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620) rootfs on / type rootfs (rw) /dev/sdb1 on /root/mnt1 type ext3 (rw) |
#cd /root/mnt1
|
#df
Filesystem 1K-blocks Used Available Use% Mounted on tmpfs 1029444 0 1029444 0% /lib/init/rw udev 10240 132 10108 2% /dev tmpfs 1029444 4 1029440 1% /dev/shm rootfs 307663800 1709336 290326032 1% / /dev/sdb1 9621848 152684 8980388 2% /root/mnt1 |
#lsof -D /root/mnt1/
bash: lsof: command not found |
#apt-file search lsof
freebsd-manpages: /usr/share/man/man9/splsoftclock.9freebsd.gz freebsd-manpages: /usr/share/man/man9/splsofttty.9freebsd.gz kde-l10n-ar: /usr/share/locale/ar/LC_MESSAGES/ksysguardlsofwidgets.mo kde-l10n-bnin: /usr/share/locale/bn_IN/LC_MESSAGES/ksysguardlsofwidgets.mo kde-l10n-ca: /usr/share/locale/ca/LC_MESSAGES/ksysguardlsofwidgets.mo kde-l10n-cs: /usr/share/locale/cs/LC_MESSAGES/ksysguardlsofwidgets.mo kde-l10n-da: /usr/share/locale/da/LC_MESSAGES/ksysguardlsofwidgets.mo kde-l10n-de: /usr/share/locale/de/LC_MESSAGES/ksysguardlsofwidgets.mo kde-l10n-el: /usr/share/locale/el/LC_MESSAGES/ksysguardlsofwidgets.mo kde-l10n-engb: /usr/share/locale/en_GB/LC_MESSAGES/ksysguardlsofwidgets.mo ... picon-usenix: /usr/share/picons/usenix/uucp/jlsoft/marquez/face.xbm picon-usenix: /usr/share/picons/usenix/uucp/jlsoft/marquez/face.xpm python-wxgtk2.8: /usr/lib/python2.4/site-packages/wx-2.8-gtk2-unicode/wx/tools/Editra/tests/nullsoft_installer_script.nsi python-wxgtk2.8: /usr/lib/python2.5/site-packages/wx-2.8-gtk2-unicode/wx/tools/Editra/tests/nullsoft_installer_script.nsi recoll: /usr/share/recoll/filters/rclsoff xboing: /usr/share/games/xboing/sounds/wallsoff.au zsh: /usr/share/zsh/functions/Completion/Unix/_lsof zsh: /usr/share/zsh/functions/Completion/Unix/_xmlsoft zsh-beta: /usr/share/zsh-beta/functions/Completion/Unix/_lsof zsh-beta: /usr/share/zsh-beta/functions/Completion/Unix/_xmlsoft |
#apt-get install lsof
Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: portmap Use 'apt-get autoremove' to remove them. The following NEW packages will be installed: lsof 0 upgraded, 1 newly installed, 0 to remove and 20 not upgraded. Need to get 275kB of archives. After this operation, 451kB of additional disk space will be used. Get:1 http://127.0.0.1 sid/main lsof 4.81.dfsg.1-1 [275kB] Fetched 275kB in 0s (1738kB/s) Selecting previously deselected package lsof. (Reading database ... 54688 files and directories currently installed.) Unpacking lsof (from .../lsof_4.81.dfsg.1-1_i386.deb) ... Processing triggers for man-db ... Setting up lsof (4.81.dfsg.1-1) ... |
#!lso
lsof -D /root/mnt1/ lsof: unsupported option: -D lsof 4.81 latest revision: ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/ latest FAQ: ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/FAQ latest man page: ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/lsof_man usage: [-?abhlnNoOPRtUvVX] [+|-c c] [+|-d s] [+D D] [+|-f[gG]] [-F [f]] [-g [s]] [-i [i]] [+|-L [l]] [+m [m]] [+|-M] [-o [o]] [-p s] [+|-r [t]] [-s [p:s]] [-S [t]] [-T [t]] [-u s] [+|-w] [-x [fl]] [--] [names] Use the ``-h'' option to get more help information. |
#lsof +D /root/mnt1/
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME bash 4130 root cwd DIR 8,17 4096 2 /root/mnt1 lsof 15000 root cwd DIR 8,17 4096 2 /root/mnt1 lsof 15001 root cwd DIR 8,17 4096 2 /root/mnt1 |
#fuser
No process specification given Usage: fuser [ -fuv ] [ -a | -s ] [ -4 | -6 ] [ -c | -m | -n SPACE ] [ -k [ -i ] [ -SIGNAL ]] NAME... fuser -l fuser -V Show which processes use the named files, sockets, or filesystems. -a display unused files too -c Same as -m (for POSIX compatibility) -f silently ignored (for POSIX compatibility) -i ask before killing (ignored without -k) -k kill processes accessing the named file ... -n SPACE search in this name space (file, udp, or tcp) -s silent operation -SIGNAL send this signal instead of SIGKILL -u display user IDs -v verbose output -V display version information -4 search IPv4 sockets only -6 search IPv6 sockets only - reset options udp/tcp names: [local_port][,[rmt_host][,[rmt_port]]] |
#fuser /root/mnt1
/root/mnt1: 4130c |
#ps aux | grep 4130
root 4130 0.0 0.2 7956 4728 pts/9 Rs 09:38 0:01 bash root 15060 0.0 0.0 3952 744 pts/9 S+ 12:20 0:00 grep 4130 |
#mount
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755) proc on /proc type proc (rw,noexec,nosuid,nodev) sysfs on /sys type sysfs (rw,noexec,nosuid,nodev) procbususb on /proc/bus/usb type usbfs (rw) udev on /dev type tmpfs (rw,mode=0755) tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev) devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620) rootfs on / type rootfs (rw) /dev/sdb1 on /root/mnt1 type ext3 (rw) |
#umount /root/mnt1
umount: /root/mnt1: device is busy umount: /root/mnt1: device is busy |
#cd ~
|
#umount /root/mnt1
|
#vi /etc/fstab
|
#man 5 fstab
|
#man 5 fstab
|
#ls -l /dev/disk/
total 0 drwxr-xr-x 2 root root 400 2009-05-30 12:00 by-id drwxr-xr-x 2 root root 80 2009-05-30 12:10 by-label drwxr-xr-x 2 root root 240 2009-05-30 12:00 by-path drwxr-xr-x 2 root root 100 2009-05-30 12:04 by-uuid |
#ls -l /dev/disk/by-uuid/
total 0 lrwxrwxrwx 1 root root 17 2009-05-30 11:08 06ee3e4f-bb00-46df-9acc-ca52fb1b8ea2 -> ../../etherd/e1.1 lrwxrwxrwx 1 root root 10 2009-05-30 12:04 92fa5614-853a-45e5-b807-87301a35ab90 -> ../../sdb1 lrwxrwxrwx 1 root root 10 2009-05-30 09:24 c2a2011b-4366-4090-aeda-07c856020ed4 -> ../../sda1 |
#mount
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755) proc on /proc type proc (rw,noexec,nosuid,nodev) sysfs on /sys type sysfs (rw,noexec,nosuid,nodev) procbususb on /proc/bus/usb type usbfs (rw) udev on /dev type tmpfs (rw,mode=0755) tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev) devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620) rootfs on / type rootfs (rw) |
#mount -a
|
#mount
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755) proc on /proc type proc (rw,noexec,nosuid,nodev) sysfs on /sys type sysfs (rw,noexec,nosuid,nodev) procbususb on /proc/bus/usb type usbfs (rw) udev on /dev type tmpfs (rw,mode=0755) tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev) devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620) rootfs on / type rootfs (rw) /dev/sdb1 on /root/mnt1 type ext3 (rw) |
#tail -f -n 100 /var/log/messages
May 30 09:24:41 linux4 kernel: [ 5.730943] udev: starting version 141 May 30 09:24:41 linux4 kernel: [ 5.899499] input: Power Button (FF) as /devices/LNXSYSTM:00/LNXPWRBN:00/input/input2 May 30 09:24:41 linux4 kernel: [ 5.899577] ACPI: Power Button (FF) [PWRF] May 30 09:24:41 linux4 kernel: [ 5.899748] input: Sleep Button (CM) as /devices/LNXSYSTM:00/device:00/PNP0C0E:00/input/input3 May 30 09:24:41 linux4 kernel: [ 5.899826] ACPI: Sleep Button (CM) [SLPB] May 30 09:24:41 linux4 kernel: [ 5.947423] parport_pc 00:08: reported by Plug and Play ACPI May 30 09:24:41 linux4 kernel: [ 5.947535] parport0: PC-style at 0x378, irq 7 [PCSPP,TRISTATE] May 30 09:24:41 linux4 kernel: [ 6.145277] pci_hotplug: PCI Hot Plug PCI Core version: 0.5 May 30 09:24:41 linux4 kernel: [ 6.185399] shpchp: Standard Hot Plug PCI Controller Driver version: 0.4 May 30 09:24:41 linux4 kernel: [ 6.226771] Intel 82802 RNG detected ... May 30 12:37:35 linux4 kernel: [11587.896728] usbcore: registered new interface driver usb-storage May 30 12:37:35 linux4 kernel: [11587.896736] USB Mass Storage support registered. May 30 12:37:40 linux4 kernel: [11592.908721] scsi 2:0:0:0: Direct-Access Kingston DataTraveler 2.0 5.00 PQ: 0 ANSI: 0 CCS May 30 12:37:42 linux4 kernel: [11594.671228] sd 2:0:0:0: [sdc] 8058880 512-byte hardware sectors: (4.12 GB/3.84 GiB) May 30 12:37:42 linux4 kernel: [11594.671718] sd 2:0:0:0: [sdc] Write Protect is off May 30 12:37:42 linux4 kernel: [11594.676228] sd 2:0:0:0: [sdc] 8058880 512-byte hardware sectors: (4.12 GB/3.84 GiB) May 30 12:37:42 linux4 kernel: [11594.676718] sd 2:0:0:0: [sdc] Write Protect is off May 30 12:37:42 linux4 kernel: [11594.676736] sdc: sdc1 May 30 12:37:42 linux4 kernel: [11594.677700] sd 2:0:0:0: [sdc] Attached SCSI removable disk ^C |
#ls - l /
ls: cannot access -: No such file or directory ls: cannot access l: No such file or directory /: bin dev flash initrd.img lost+found mnt proc sbin srv tmp var boot etc home lib media opt root selinux sys usr vmlinuz |
#ls -l /
total 76 drwxr-xr-x 2 root root 4096 2009-05-25 03:02 bin drwxr-xr-x 3 root root 4096 2009-05-25 03:04 boot drwxr-xr-x 15 root root 3800 2009-05-30 12:37 dev drwxr-xr-x 86 root root 4096 2009-05-30 12:42 etc drwxr-xr-x 2 root root 4096 2009-05-30 12:40 flash drwxr-xr-x 3 root root 4096 2009-05-25 01:07 home lrwxrwxrwx 1 root root 28 2002-01-01 00:39 initrd.img -> boot/initrd.img-2.6.29-2-686 drwxr-xr-x 13 root root 12288 2009-05-30 11:56 lib drwx------ 2 root root 4096 2009-05-24 21:51 lost+found ... dr-xr-xr-x 118 root root 0 2009-05-30 09:24 proc drwxr-xr-x 7 root root 4096 2009-05-30 12:42 root drwxr-xr-x 2 root root 4096 2009-05-30 11:56 sbin drwxr-xr-x 2 root root 4096 2009-02-21 16:55 selinux drwxr-xr-x 2 root root 4096 2009-05-24 13:15 srv drwxr-xr-x 12 root root 0 2009-05-30 09:24 sys drwxrwxrwt 7 root root 4096 2009-05-30 12:42 tmp drwxr-xr-x 11 root root 4096 2009-05-24 13:22 usr drwxr-xr-x 13 root root 4096 2009-05-24 13:15 var lrwxrwxrwx 1 root root 25 2002-01-01 00:39 vmlinuz -> boot/vmlinuz-2.6.29-2-686 |
#ls -l /media/
total 0 |
#rmdir /flash
|
#mkdir /media/flash
|
#vi /etc/fstab
|
#vi /etc/fstab
|
#mount
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755) proc on /proc type proc (rw,noexec,nosuid,nodev) sysfs on /sys type sysfs (rw,noexec,nosuid,nodev) procbususb on /proc/bus/usb type usbfs (rw) udev on /dev type tmpfs (rw,mode=0755) tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev) devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620) rootfs on / type rootfs (rw) /dev/sdb1 on /root/mnt1 type ext3 (rw) |
#mount -a
|
#mount
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755) proc on /proc type proc (rw,noexec,nosuid,nodev) sysfs on /sys type sysfs (rw,noexec,nosuid,nodev) procbususb on /proc/bus/usb type usbfs (rw) udev on /dev type tmpfs (rw,mode=0755) tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev) devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620) rootfs on / type rootfs (rw) /dev/sdb1 on /root/mnt1 type ext3 (rw) |
#mount
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755) proc on /proc type proc (rw,noexec,nosuid,nodev) sysfs on /sys type sysfs (rw,noexec,nosuid,nodev) procbususb on /proc/bus/usb type usbfs (rw) udev on /dev type tmpfs (rw,mode=0755) tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev) devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620) rootfs on / type rootfs (rw) /dev/sdb1 on /root/mnt1 type ext3 (rw) |
#ls /dev/sdc*
/dev/sdc /dev/sdc1 |
#file -s /dev/sdc1
/dev/sdc1: x86 boot sector, code offset 0x58, OEM-ID "MSDOS5.0", sectors/cluster 8, reserved sectors 34, Media descriptor 0xf8, heads 255, hidden sectors 32, sectors 8058848 (volumes > 32 MB) , FAT (32 bit), sectors/FAT 7855, serial number 0xd46d87da, unlabeled |
#cat /etc/fstab
# UNCONFIGURED FSTAB FOR BASE SYSTEM LABEL=TEST_VOL /root/mnt1 ext3 defaults 1 0 /dev/sdc1 /media/flash auto user,noauto,iocharset=utf8 0 0 |
#mount -a
|
#mount
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755) proc on /proc type proc (rw,noexec,nosuid,nodev) sysfs on /sys type sysfs (rw,noexec,nosuid,nodev) procbususb on /proc/bus/usb type usbfs (rw) udev on /dev type tmpfs (rw,mode=0755) tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev) devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620) rootfs on / type rootfs (rw) /dev/sdb1 on /root/mnt1 type ext3 (rw) |
#vi /etc/fstab
|
$mount
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755) proc on /proc type proc (rw,noexec,nosuid,nodev) sysfs on /sys type sysfs (rw,noexec,nosuid,nodev) procbususb on /proc/bus/usb type usbfs (rw) udev on /dev type tmpfs (rw,mode=0755) tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev) devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620) rootfs on / type rootfs (rw) /dev/sdb1 on /root/mnt1 type ext3 (rw) |
$mount -a
mount: only root can do that |
$mount /media/flash
|
$ls -l /media/flash
total 36 drwxr-xr-x 5 user user 4096 2009-05-22 21:48 Dead Kennedys drwxr-xr-x 3 user user 4096 2009-05-22 21:48 Djivan Gasparayan drwxr-xr-x 3 user user 4096 2009-05-22 21:47 Harold Budd drwxr-xr-x 12 user user 4096 2009-05-22 21:22 Аквариум drwxr-xr-x 8 user user 4096 2009-05-22 21:21 Гражданская оборона drwxr-xr-x 5 user user 4096 2009-05-22 21:22 Псой Короленко drwxr-xr-x 4 user user 4096 2009-05-22 21:21 Рада и Терновник drwxr-xr-x 9 user user 4096 2009-05-22 21:22 Фёдоров и Ко drwxr-xr-x 6 user user 4096 2009-05-22 21:44 Янка |
$umount /media/flash
|
#mount
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755) proc on /proc type proc (rw,noexec,nosuid,nodev) sysfs on /sys type sysfs (rw,noexec,nosuid,nodev) procbususb on /proc/bus/usb type usbfs (rw) udev on /dev type tmpfs (rw,mode=0755) tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev) devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620) rootfs on / type rootfs (rw) /dev/sdb1 on /root/mnt1 type ext3 (rw) |
$mount
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755) proc on /proc type proc (rw,noexec,nosuid,nodev) sysfs on /sys type sysfs (rw,noexec,nosuid,nodev) procbususb on /proc/bus/usb type usbfs (rw) udev on /dev type tmpfs (rw,mode=0755) tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev) devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620) rootfs on / type rootfs (rw) /dev/sdb1 on /root/mnt1 type ext3 (rw) /dev/sdc1 on /media/flash type vfat (rw,noexec,nosuid,nodev,iocharset=utf8,codepage=866,user=user) |
$umount /media/flash
|
# UNCONFIGURED FSTAB FOR BASE SYSTEM LABEL=TEST_VOL /root/mnt1 ext3 defaults 1 0 /dev/sdc1 /media/flash auto user,noauto,iocharset=utf8 0 0
Время первой команды журнала | 10:39:48 2009- 5-30 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Время последней команды журнала | 12:52:35 2009- 5-30 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в журнале | 101 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент команд с ненулевым кодом завершения, % | 10.89 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент синтаксически неверно набранных команд, % | 0.99 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Суммарное время работы с терминалом *, час | 2.21 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в единицу времени, команда/мин | 0.76 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Частота использования команд |
|
В журнал автоматически попадают все команды, данные в любом терминале системы.
Для того чтобы убедиться, что журнал на текущем терминале ведётся, и команды записываются, дайте команду w. В поле WHAT, соответствующем текущему терминалу, должна быть указана программа script.
Команды, при наборе которых были допущены синтаксические ошибки, выводятся перечёркнутым текстом:
$ l s-l bash: l: command not found |
Если код завершения команды равен нулю, команда была выполнена без ошибок. Команды, код завершения которых отличен от нуля, выделяются цветом.
$ test 5 -lt 4 |
Команды, ход выполнения которых был прерван пользователем, выделяются цветом.
$ find / -name abc find: /home/devi-orig/.gnome2: Keine Berechtigung find: /home/devi-orig/.gnome2_private: Keine Berechtigung find: /home/devi-orig/.nautilus/metafiles: Keine Berechtigung find: /home/devi-orig/.metacity: Keine Berechtigung find: /home/devi-orig/.inkscape: Keine Berechtigung ^C |
Команды, выполненные с привилегиями суперпользователя, выделяются слева красной чертой.
# id uid=0(root) gid=0(root) Gruppen=0(root) |
Изменения, внесённые в текстовый файл с помощью редактора, запоминаются и показываются в журнале в формате ed. Строки, начинающиеся символом "<", удалены, а строки, начинающиеся символом ">" -- добавлены.
$ vi ~/.bashrc
|
Для того чтобы изменить файл в соответствии с показанными в диффшоте изменениями, можно воспользоваться командой patch. Нужно скопировать изменения, запустить программу patch, указав в качестве её аргумента файл, к которому применяются изменения, и всавить скопированный текст:
$ patch ~/.bashrc |
Для того чтобы получить краткую справочную информацию о команде, нужно подвести к ней мышь. Во всплывающей подсказке появится краткое описание команды.
Если справочная информация о команде есть, команда выделяется голубым фоном, например: vi. Если справочная информация отсутствует, команда выделяется розовым фоном, например: notepad.exe. Справочная информация может отсутствовать в том случае, если (1) команда введена неверно; (2) если распознавание команды LiLaLo выполнено неверно; (3) если информация о команде неизвестна LiLaLo. Последнее возможно для редких команд.
Большие, в особенности многострочные, всплывающие подсказки лучше всего показываются браузерами KDE Konqueror, Apple Safari и Microsoft Internet Explorer. В браузерах Mozilla и Firefox они отображаются не полностью, а вместо перевода строки выводится специальный символ.
Время ввода команды, показанное в журнале, соответствует времени начала ввода командной строки, которое равно тому моменту, когда на терминале появилось приглашение интерпретатора
Имя терминала, на котором была введена команда, показано в специальном блоке. Этот блок показывается только в том случае, если терминал текущей команды отличается от терминала предыдущей.
Вывод не интересующих вас в настоящий момент элементов журнала, таких как время, имя терминала и других, можно отключить. Для этого нужно воспользоваться формой управления журналом вверху страницы.
Небольшие комментарии к командам можно вставлять прямо из командной строки. Комментарий вводится прямо в командную строку, после символов #^ или #v. Символы ^ и v показывают направление выбора команды, к которой относится комментарий: ^ - к предыдущей, v - к следующей. Например, если в командной строке было введено:
$ whoami
user
$ #^ Интересно, кто я?в журнале это будет выглядеть так:
$ whoami
user
Интересно, кто я? |
Если комментарий содержит несколько строк, его можно вставить в журнал следующим образом:
$ whoami
user
$ cat > /dev/null #^ Интересно, кто я?
Программа whoami выводит имя пользователя, под которым мы зарегистрировались в системе. - Она не может ответить на вопрос о нашем назначении в этом мире.В журнале это будет выглядеть так:
$ whoami user
|
Комментарии, не относящиеся непосредственно ни к какой из команд, добавляются точно таким же способом, только вместо симолов #^ или #v нужно использовать символы #=
1 2 3 4Группы команд, выполненных на разных терминалах, разделяются специальной линией. Под этой линией в правом углу показано имя терминала, на котором выполнялись команды. Для того чтобы посмотреть команды только одного сенса, нужно щёкнуть по этому названию.
LiLaLo (L3) расшифровывается как Live Lab Log.
Программа разработана для повышения эффективности обучения Unix/Linux-системам.
(c) Игорь Чубин, 2004-2008