当前位置:   article > 正文

[20190301]简单测试linux fsfreeze命令.txt

fsfreeze

[20190301]简单测试linux fsfreeze命令.txt


--//简单测试学习linux的fsfreeze命令.


# man fsfreeze

FSFREEZE(8)                  System Administration                 FSFREEZE(8)


NAME

       fsfreeze - suspend access to a filesystem (Linux Ext3/4, ReiserFS, JFS, XFS)


SYNOPSIS

       fsfreeze -f mountpoint


       fsfreeze -u mountpoint


DESCRIPTION

       fsfreeze suspends and resumes access to an filesystem


  fsfreeze halts new access to the filesystem and creates a stable image on disk.  fsfreeze is intended to be used

  with hardware RAID devices that support the creation of snapshots.


  fsfreeze is unnecessary for device-mapper devices. The device-mapper (and LVM) automatically freezes filesystem

  on the device when a  snapshot  creation is requested.  For more details see the dmsetup(8) man page.


  The  mount-point argument is the pathname of the directory where the filesystem is mounted.  The filesystem must

  be mounted to be frozen (see mount(8)).


..


-f, --freeze

  This option requests the specified a filesystem to be frozen from new modifications.  When this is selected,  all

  ongoing  transactions  in  the filesystem  are  allowed  to complete, new write system calls are halted, other

  calls which modify the filesystem are halted, and all dirty data,metadata, and log information are written to

  disk.  Any process attempting to write to the frozen filesystem will block waiting for the  filesystem to be

  unfrozen.


Note  that  even after freezing, the on-disk filesystem can contain information on files that are still in the process

  of unlinking.  These files will not be unlinked until the filesystem is unfrozen or a clean mount of the snapshot

  is complete.


-u, --unfreeze

 This option is used to un-freeze the filesystem and allow operations to continue.  Any filesystem modifications

 that were blocked by  the  freeze are unblocked and allowed to complete.


--//很简单-f 冻结,-u 解冻.这样可以在出现一些意外操作时临时冻结文件系统.


1.测试:


# dd if=/dev/zero of=image.10m count=1 bs=10M

1+0 records in

1+0 records out

10485760 bytes (10 MB) copied, 0.0483896 seconds, 217 MB/s


# mke4fs image.10m

mke4fs 1.41.12 (17-May-2010)

image.10m 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

2560 inodes, 10240 blocks

512 blocks (5.00%) reserved for the super user

First data block=1

Maximum filesystem blocks=10485760

2 block groups

8192 blocks per group, 8192 fragments per group

1280 inodes per group

Superblock backups stored on blocks:

        8193


Writing inode tables: done

Creating journal (1024 blocks): done

Writing superblocks and filesystem accounting information: done


This filesystem will be automatically checked every 38 mounts or

180 days, whichever comes first.  Use tune4fs -c or -i to override.


# mount -o loop image.10m /mnt/backup/


# cd /mnt/backup

# echo 'this is a testcat '> test1.txt


2.测试:

--//冻结

# fsfreeze -f /mnt/backup/

# echo 'this is a testcat '>> /mnt/backup/test1.txt

--//... 挂起.不能写入信息


--//解冻:

# fsfreeze -u /mnt/backup/

--//查看另外窗口:

# echo 'this is a testcat '>> test1.txt


# cat test1.txt

this is a test!!

this is a testcat


--//不知道在实际工作中是否有用.


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/267265/viewspace-2637261/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/267265/viewspace-2637261/

本文内容由网友自发贡献,转载请注明出处:https://www.wpsshop.cn/w/你好赵伟/article/detail/217496?site
推荐阅读
相关标签
  

闽ICP备14008679号