| /l3/users/bas/2011-03/linux4.unix.bas/user :1 :2 :3 :4 :5 :6 :7 :8 :9 :10 :11 :12 :13 |
|
|
#file -s /dev/sda1
/dev/sda1: Linux rev 1.0 ext3 filesystem data (needs journal recovery) (large files) |
|
#file -s /dev/sda8
/dev/sda8: data |
|
#mkfs.ext3 /dev/sda8
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
125184 inodes, 250236 blocks
12511 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=260046848
8 block groups
32768 blocks per group, 32768 fragments per group
15648 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376
Writing inode tables: done
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 26 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
|
|
#mkdi
mkdict mkdir |
|
#mkdi
mkdict mkdir |
|
#mkdir /dev/sda8 /data
mkdir: cannot create directory `/dev/sda8': File exists You have new mail in /var/spool/mail/root |
|
#ls -l
total 1230124 -rw------- 1 root root 1016 Mar 27 21:17 anaconda-ks.cfg drwxr-xr-x 3 root root 4096 Mar 28 18:14 backups -rw-r--r-- 1 root root 2061 Mar 30 13:13 cpumem.info drwxr-xr-x 3 root root 4096 Apr 1 14:10 Desktop -rw-r--r-- 1 root root 1258291200 Apr 2 17:21 disk1.img -rw-r--r-- 1 root root 38088 Mar 27 21:17 install.log -rw-r--r-- 1 root root 0 Mar 27 21:08 install.log.syslog drwx------ 2 root root 4096 Mar 30 13:11 Mail -rw-r--r-- 1 root root 12680 Nov 13 10:12 rpmforge-release-0.5.2-2.el5.rf.i386.rpm -rw-r--r-- 1 root root 12680 Nov 13 10:12 rpmforge-release-0.5.2-2.el5.rf.i386.rpm.1 -rw-r--r-- 1 root root 12649 Nov 13 10:12 rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm |
|
#mkdir /data
mkdir: cannot create directory `/data': File exists |
|
#mkdir data
|
|
#mount
mount mount.ecryptfs_private mountpoint mount.cifs mount.nfs mount.ecryptfs mount.nfs4 |
|
#mount /dev/sda8 /data
|
|
#ls
anaconda-ks.cfg Desktop Mail backups disk1.img rpmforge-release-0.5.2-2.el5.rf.i386.rpm cpumem.info install.log rpmforge-release-0.5.2-2.el5.rf.i386.rpm.1 data install.log.syslog rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm |
|
#df
Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda1 5078640 1767692 3048808 37% / /dev/sda7 2031528 78468 1848200 5% /tmp /dev/sda5 10157352 317028 9316040 4% /var /dev/sda3 10157368 204356 9428724 3% /home /dev/sda2 20314748 2753688 16512484 15% /usr tmpfs 2008180 0 2008180 0% /dev/shm /dev/sda8 985192 17652 917496 2% /data |
|
#unmount /data
bash: unmount: command not found |
|
#umount /data
|
|
#[root@linux2:spool]# e2label /dev/sda10 DATA10
bash: [root@linux2:spool]#: command not found |
|
#e2label /dev/sda8 DATA
|
|
#mount DATA
mount: can't find DATA in /etc/fstab or /etc/mtab |
|
#mount DATA /data
mount: special device DATA does not exist |
|
#e2label /dev/sda8 DATA
|
|
#e2label
Usage: e2label device [newlabel] |
|
#e2label
Usage: e2label device [newlabel] |
|
#df
Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda1 5078640 1767700 3048800 37% / /dev/sda7 2031528 78468 1848200 5% /tmp /dev/sda5 10157352 317028 9316040 4% /var /dev/sda3 10157368 204360 9428720 3% /home /dev/sda2 20314748 2753688 16512484 15% /usr tmpfs 2008180 0 2008180 0% /dev/shm |
|
#e2label /dev/sda8
DATA |
|
#mount -L DATA10 /data10
mount: no such partition found |
|
#mount -L DATA /data
|
|
#vim /etc/fstab
|
|
#vim /etc/fstab
|
|
#mount /data
|
|
#df
Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda1 5078640 1767728 3048772 37% / /dev/sda7 2031528 78468 1848200 5% /tmp /dev/sda5 10157352 317028 9316040 4% /var /dev/sda3 10157368 206456 9426624 3% /home /dev/sda2 20314748 2753688 16512484 15% /usr tmpfs 2008180 0 2008180 0% /dev/shm /dev/sda8 985192 17652 917496 2% /data |
|
#umount /data
|
|
#mount /data
|
|
#fdisk /dev/sda
The number of cylinders for this disk is set to 763104. 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): p Disk /dev/sda: 500.1 GB, 500107862016 bytes 40 heads, 32 sectors/track, 763104 cylinders Units = cylinders of 1280 * 512 = 655360 bytes ... Last cylinder or +size or +sizeM or +sizeK (81847-763104, default 763104): 5000M Value out of range. Last cylinder or +size or +sizeM or +sizeK (81847-763104, default 763104): +50G Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. WARNING: Re-reading the partition table failed with error 16: Device or resource busy. The kernel still uses the old table. The new table will be used at the next reboot. Syncing disks. |
|
#fdisk /dev/sda
The number of cylinders for this disk is set to 763104. 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): p Disk /dev/sda: 500.1 GB, 500107862016 bytes 40 heads, 32 sectors/track, 763104 cylinders Units = cylinders of 1280 * 512 = 655360 bytes ... First cylinder (158142-763104, default 158142): Using default value 158142 Last cylinder or +size or +sizeM or +sizeK (158142-763104, default 763104): +50G Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. WARNING: Re-reading the partition table failed with error 16: Device or resource busy. The kernel still uses the old table. The new table will be used at the next reboot. Syncing disks. |
|
#fdisk /dev/sda
The number of cylinders for this disk is set to 763104. 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): p Disk /dev/sda: 500.1 GB, 500107862016 bytes 40 heads, 32 sectors/track, 763104 cylinders Units = cylinders of 1280 * 512 = 655360 bytes ... First cylinder (234437-763104, default 234437): Using default value 234437 Last cylinder or +size or +sizeM or +sizeK (234437-763104, default 763104): +50G Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. WARNING: Re-reading the partition table failed with error 16: Device or resource busy. The kernel still uses the old table. The new table will be used at the next reboot. Syncing disks. |
|
#partprobe
|
|
#df
Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda1 5078640 1767748 3048752 37% / /dev/sda7 2031528 78468 1848200 5% /tmp /dev/sda5 10157352 317032 9316036 4% /var /dev/sda3 10157368 206500 9426580 3% /home /dev/sda2 20314748 2753688 16512484 15% /usr tmpfs 2008180 0 2008180 0% /dev/shm /dev/sda8 985192 17652 917496 2% /data |
|
#cat /proc/partitions
major minor #blocks name 8 0 488386584 sda 8 1 5242864 sda1 8 2 20971520 sda2 8 3 10485760 sda3 8 4 0 sda4 8 5 10485744 sda5 8 6 2097264 sda6 8 7 2097264 sda7 8 8 1000944 sda8 8 9 48828784 sda9 8 10 48828784 sda10 8 11 48828784 sda11 |
|
#mdadm
Usage: mdadm --help for help |
|
#mdadm -C /dev/md0 -l1 -n2 /dev/sda9 /dev/sda10
mdadm: array /dev/md0 started. |
|
#cat /proc/mdstat
Personalities : [raid1]
md0 : active raid1 sda10[1] sda9[0]
48828672 blocks [2/2] [UU]
[>....................] resync = 1.3% (645760/48828672) finish=18.6min speed=43050K/sec
unused devices: <none>
|
|
#cat /proc/mdstat watch
Personalities : [raid1]
md0 : active raid1 sda10[1] sda9[0]
48828672 blocks [2/2] [UU]
[>....................] resync = 3.9% (1925440/48828672) finish=18.5min speed=42068K/sec
unused devices: <none>
cat: watch: No such file or directory
|
|
#watch cat /proc/mdstat
|
|
#cat /proc/mdstat
Personalities : [raid1]
md0 : active raid1 sda10[1] sda9[0]
48828672 blocks [2/2] [UU]
[==>..................] resync = 14.3% (7019904/48828672) finish=17.1min speed=40706K/sec
unused devices: <none>
|
|
#cat /proc/mdstat
Personalities : [raid1]
md0 : active raid1 sda10[1] sda9[0]
48828672 blocks [2/2] [UU]
[===>.................] resync = 19.4% (9520896/48828672) finish=15.5min speed=42083K/sec
unused devices: <none>
|
|
#cat /proc/mdstat
Personalities : [raid1]
md0 : active raid1 sda10[1] sda9[0]
48828672 blocks [2/2] [UU]
[===>.................] resync = 19.6% (9578368/48828672) finish=15.8min speed=41274K/sec
unused devices: <none>
|
|
#cat /proc/mdstat
Personalities : [raid1]
md0 : active raid1 sda10[1] sda9[0]
48828672 blocks [2/2] [UU]
[=====>...............] resync = 29.8% (14590912/48828672) finish=13.8min speed=41064K/sec
unused devices: <none>
|
|
#pvcreate /dev/md0
Physical volume "/dev/md0" successfully created |
|
#vgcreate VGI /dev/md0
Volume group "VGI" successfully created |
|
#df
Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda1 5078640 1767776 3048724 37% / /dev/sda7 2031528 78468 1848200 5% /tmp /dev/sda5 10157352 317024 9316044 4% /var /dev/sda3 10157368 206432 9426648 3% /home /dev/sda2 20314748 2753688 16512484 15% /usr tmpfs 2008180 0 2008180 0% /dev/shm /dev/sda8 985192 17652 917496 2% /data |
|
#pvdisplay
--- Physical volume --- PV Name /dev/md0 VG Name VGI PV Size 46.57 GB / not usable 256.00 KB Allocatable yes PE Size (KByte) 4096 Total PE 11921 Free PE 11921 Allocated PE 0 PV UUID DJl0Z7-CBwV-xuW7-c2Qj-t2Gp-y0n8-PHavXO |
|
#vgdisplay
--- Volume group --- VG Name VGI System ID Format lvm2 Metadata Areas 1 Metadata Sequence No 1 VG Access read/write VG Status resizable MAX LV 0 Cur LV 0 Open LV 0 Max PV 0 Cur PV 1 Act PV 1 VG Size 46.57 GB PE Size 4.00 MB Total PE 11921 Alloc PE / Size 0 / 0 Free PE / Size 11921 / 46.57 GB VG UUID S09BqA-z304-yrOA-oNaQ-Pvdf-FlHX-0BgGfe |
|
#lvcreate -L2G -n vol1 /dev/VG1
Volume group "VG1" not found |
|
#lvcreate -L2G -n vol1 /dev/VG1
Volume group "VG1" not found |
|
#lvcreate -L2G -n vol1 /dev/VG1
Volume group "VG1" not found |
|
#lvcreate -L2G -n vol1 /dev/VG1
Volume group "VG1" not found |
|
#lvcreate -L2G -n vol1 /dev/VG1
Volume group "VG1" not found |
|
#lvcreate -L2G -n vol1 /dev/VG
Volume group "VG" not found |
|
#lvcreate -L2G -n vol1 /dev/VG11
Volume group "VG11" not found |
|
#lvcreate -L2G -n voll /dev/VG1
Volume group "VG1" not found |
|
|