[20170928]tune4fs.txt

简介: [20170928]tune4fs.txt --//昨天做了使用tune2fs调整保留块百分比的测试,今天才发现,我们生产分区不是ext3而是ext4. --//我重复测试看看: 1.

[20170928]tune4fs.txt

--//昨天做了使用tune2fs调整保留块百分比的测试,今天才发现,我们生产分区不是ext3而是ext4.
--//我重复测试看看:

1.建立测试环境:
# dd if=/dev/zero of=100m bs=1M count=100
100+0 records in
100+0 records out
104857600 bytes (105 MB) copied, 0.272268 seconds, 385 MB/s
--//注:bs=1M,M要大写.另外注意输出的MB的单位,感觉这样输出不对.

# mkfs.ext4 100m
mke4fs 1.41.12 (17-May-2010)
100m is not a block special device.
Proceed anyway? (y,n) y
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
Stride=0 blocks, Stripe width=0 blocks
25688 inodes, 102400 blocks
5120 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=67371008
13 block groups
8192 blocks per group, 8192 fragments per group
1976 inodes per group
Superblock backups stored on blocks:
        8193, 24577, 40961, 57345, 73729

Writing inode tables: done
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 20 mounts or
180 days, whichever comes first.  Use tune4fs -c or -i to override.

# tune2fs -l 100m
tune2fs 1.39 (29-May-2006)
tune2fs: Filesystem has unsupported feature(s) while trying to open 100m
Couldn't find valid filesystem superblock.
--//无法获取信息.

# tune4fs -l 100m
tune4fs 1.41.12 (17-May-2010)
Filesystem volume name:   <none>
Last mounted on:          <not available>
Filesystem UUID:          1b697663-dd42-4290-88cb-df3face16aba
Filesystem magic number:  0xEF53
Filesystem revision #:    1 (dynamic)
Filesystem features:      has_journal ext_attr resize_inode dir_index filetype extent flex_bg sparse_super huge_file uninit_bg dir_nlink extra_isize
Filesystem flags:         signed_directory_hash
Default mount options:    (none)
Filesystem state:         clean
Errors behavior:          Continue
Filesystem OS type:       Linux
Inode count:              25688
Block count:              102400
Reserved block count:     5120
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Free blocks:              93504
Free inodes:              25677
First block:              1
Block size:               1024
Fragment size:            1024
Reserved GDT blocks:      256
Blocks per group:         8192
Fragments per group:      8192
Inodes per group:         1976
Inode blocks per group:   247
Flex block group size:    16
Filesystem created:       Wed Sep 27 09:10:38 2017
Last mount time:          n/a
Last write time:          Wed Sep 27 09:10:38 2017
Mount count:              0
Maximum mount count:      20
Last checked:             Wed Sep 27 09:10:38 2017
Check interval:           15552000 (6 months)
Next check after:         Mon Mar 26 09:10:38 2018
Lifetime writes:          7678 kB
Reserved blocks uid:      0 (user root)
Reserved blocks gid:      0 (group root)
First inode:              11
Inode size:               128
Journal inode:            8
Default directory hash:   half_md4
Directory Hash Seed:      c9d363f1-2cc6-4f9f-8d91-3a407bae5b86
Journal backup:           inode blocks

2.测试:

# mount -o loop 100m /mnt/backup/
# df | egrep "backup|File"
Filesystem            Size  Used Avail Use% Mounted on
/home/oracle/100m      97M  5.6M   87M   7% /mnt/backup

# mkdir /mnt/backup/test
# chown oracle:oinstall /mnt/backup/test
# chmod 777 /mnt/backup/test

--//以oracle用户执行:
$ dd if=/dev/zero of=/mnt/backup/test/96m bs=1M count=96
dd: writing `/mnt/backup/test/96m': No space left on device
87+0 records in
86+0 records out
90357760 bytes (90 MB) copied, 0.554884 seconds, 163 MB/s

# tune4fs -r 0 100m
tune4fs 1.41.12 (17-May-2010)
Setting reserved blocks count to 0

$ rm /mnt/backup/test/96m

$ dd if=/dev/zero of=/mnt/backup/test/96m bs=1M count=96
dd: writing `/mnt/backup/test/96m': No space left on device
87+0 records in
86+0 records out
90357760 bytes (90 MB) copied, 0.521343 seconds, 173 MB/s

# umount /mnt/backup/

# tune4fs -l 100m | grep "Reserved block count:"
Reserved block count:     5120
--//可以发现修改无效!!

# tune4fs -r 0 100m
tune4fs 1.41.12 (17-May-2010)
Setting reserved blocks count to 0

# mount -o loop 100m /mnt/backup/

# df | egrep "backup|File"
Filesystem            Size  Used Avail Use% Mounted on
/home/oracle/100m      97M   92M  5.2M  95% /mnt/backup

$ dd if=/dev/zero of=/mnt/backup/test/96m bs=1M count=96
dd: writing `/mnt/backup/test/96m': No space left on device
92+0 records in
91+0 records out
95600640 bytes (96 MB) copied, 0.501282 seconds, 191 MB/s

--//对比前面可以写入更多内容.一样注意要在umount状态下修改才有效.

目录
相关文章
|
4月前
|
Java
Files.find 去除部分目录/dev/fd,/proc如何操作
在使用 `Files.find` 方法时,如果你想在搜索过程中排除特定目录,如 `/dev/fd` 和 `/proc`,可以在 `BiPredicate` 实现中添加相应的逻辑。以下是一个示例,演示如何在 `Files.find` 中排除这些目录: ```java import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.nio.file.attribute.BasicFileAttributes; imp
|
5月前
|
缓存 自然语言处理 Linux
xv6(12) 文件系统:Inode&Directory&Path
文件系统:Inode&Directory&Path
69 0
fs.readFile() 和 fs.readFileSync()
fs.readFile() 和 fs.readFileSync()
415 0
FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
/******************************************************************************** * FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck. * 说明: * 系统更新的时候遇到这个错误,记录一下处理步骤,其原因是我自己把其umount了 * 导致的问题。
6329 0
|
Linux 存储
深入解析ext2文件系统之mke2fs
上一遍博文的重点其实将ext2整体的组织框架,我们知道了ext2文件系统由块组组成,每个块组里面的组织形式。我们甚至直接把超级块和组描述符里面的内容,用十六进制形式展现了出来。这篇博文主要讲述如何mke2fs生成合适需要的ext2 文件系统,基本就是参数选择的问题。
1052 0
|
存储 Linux 开发工具
[OS][FS]查看ext3文件系统分区的superblock
本文将介绍怎样读取一个分区的superblock: 1. 首先我们查看一下在磁盘上有哪些分区,通过fdisk -l 这里有三个分区,我们下面查看/dev/sda3(这是一个device file) 2. 从/dev/sda3拷贝1024B-2048B(这就是superblock的位置)到一个叫superblock的文件 这里我们用到了dd这个工具,它在对磁盘进行这样读写操作时非常有用,具体请见man。
1124 0
|
Oracle 关系型数据库 Linux
[20180109]disk file operations.txt
[20180110]disk file operations.txt --//调查生产系统相关disk file operations问题,记录一下: 1.环境: XXXX> @ &r/ver1 PORT_STRING                  ...
1097 0