2015年9月01日レッスン宿題(練習)
一、宿題(練習)内容:
1、今回の授業の内容を復習する.
Linuxディスク管理およびファイルシステム
2、整理ディスク管理及びファイルシステム管理において設計された各種コマンドの使用を総括し、一定の例を付注する.
Linuxディスク管理およびファイルシステム
3、1つの10 Gのファイルシステムを作成して、タイプはext 4で、電源を入れて自動的に/mydataディレクトリにマウントすることができることを要求します
回答:
自分のやりたいことをやれ!ブログ、転載お断り!
1、今回の授業の内容を復習する.
Linuxディスク管理およびファイルシステム
2、整理ディスク管理及びファイルシステム管理において設計された各種コマンドの使用を総括し、一定の例を付注する.
Linuxディスク管理およびファイルシステム
3、1つの10 Gのファイルシステムを作成して、タイプはext 4で、電源を入れて自動的に/mydataディレクトリにマウントすることができることを要求します
回答:
[root@localhost ~]# fdisk /dev/sda
WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
switch off the mode (command 'c') and change display units to
sectors (command 'u').
Command (m for help): n #
First cylinder (13321-15665, default 13321):
Using default value 13321
Last cylinder, +cylinders or +size{K,M,G} (13321-15665, default 15665): +10G # 10G
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: .
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.
[root@localhost ~]# partx -a /dev/sda #
BLKPG: Device or resource busy
error adding partition 1
BLKPG: Device or resource busy
error adding partition 2
BLKPG: Device or resource busy
error adding partition 3
BLKPG: Device or resource busy
error adding partition 4
BLKPG: Device or resource busy
error adding partition 5
BLKPG: Device or resource busy
error adding partition 6
BLKPG: Device or resource busy
error adding partition 7
[root@localhost ~]# mkfs.ext4 /dev/sda8 # ext4
mke2fs 1.41.12 (17-May-2010)
=
:Linux
=4096 (log=2)
=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
655776 inodes, 2622603 blocks
131130 blocks (5.00%) reserved for the super user
=0
Maximum filesystem blocks=2688548864
81 block groups
32768 blocks per group, 32768 fragments per group
8096 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632
inode :
Creating journal (32768 blocks):
Writing superblocks and filesystem accounting information:
This filesystem will be automatically checked every 28 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
[root@localhost ~]# mkdir /mydata
[root@localhost ~]# blkid /dev/sda8 # uuid
/dev/sda8: UUID="3d8c6632-8881-4c72-81d4-1e64ad4265e5" TYPE="ext4"
[root@localhost ~]# vim /etc/fstab # fstab ,
# /etc/fstab
# Created by anaconda on Tue Aug 25 21:09:00 2015
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/VolGroup-LogVol02 / ext4 defaults 1 1
UUID=dbde3019-886c-4eb3-8a79-b15825f7f929 /boot ext4 defaults 1 2
/dev/mapper/VolGroup-LogVol00 /usr ext4 defaults 1 2
/dev/mapper/VolGroup-LogVol01 /var ext4 defaults 1 2
UUID=4bb4b88a-0a7c-42d7-8e28-d6eb5ce64bb8 swap swap defaults 0 0
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
UUID=3d8c6632-8881-4c72-81d4-1e64ad4265e5 /mydata ext4 defaults,acl 0 0
[root@localhost ~]# mount /mydata/
[root@localhost ~]# df -h #
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup-LogVol02
39G 545M 37G 2% /
tmpfs 495M 72K 495M 1% /dev/shm
/dev/sda1 477M 37M 415M 9% /boot
/dev/mapper/VolGroup-LogVol00
9.8G 3.3G 6.0G 36% /usr
/dev/mapper/VolGroup-LogVol01
9.8G 214M 9.1G 3% /var
/dev/sda8 9.8G 23M 9.3G 1% /mydata
自分のやりたいことをやれ!ブログ、転載お断り!