linux:linux-commands:fs-man
File System Manipulation
Monitor Disk Uasage
# du -h --max-depth=1
Create an F/S in RAM
Makes a partition in ram which is useful if you need a temporary working space, as read/write RAM access is fast.
# mount -t tmpfs tmpfs /mnt -o size=1024m
Harddisk Backup/Restore
Backup an entire harddisk
# dd if=/dev/sda of=/media/disk/backup/sda.backup
Restore an entire harddisk
# dd if=/media/disk/backup/sda.backup of=/dev/sda
If you zero out the blank space first, you get great space savings
# dd if=/dev/zero of=/tmp/delete.me bs=8M; rm delete.me
# dd if=/dev/hda conv=sync,noerror bs=64K | gzip -c > /mnt/sda1/hda.img.gz
Setting reserved blocks percentage to 1%
before:
[root@metstore ~]# df -hT /store*
Filesystem Type Size Used Avail Use% Mounted on
/dev/mapper/vg1-LogVol01 ext3 388G 84G 284G 23% /store1
/dev/mapper/vg2-LogVol00 ext3 395G 498M 374G 1% /store2
[root@metstore ~]# tune2fs -m 1 /dev/mapper/vg1-LogVol01 ; tune2fs -m 1 /dev/mapper/vg2-LogVol00
Setting reserved blocks percentage to 1% (1049640 blocks)
after:
[root@metstore ~]# df -hT /store*
Filesystem Type Size Used Avail Use% Mounted on
/dev/mapper/vg1-LogVol01 ext3 388G 84G 300G 22% /store1
/dev/mapper/vg2-LogVol00 ext3 395G 498M 390G 1% /store2
Testing hard disk writing speed
# time dd if=/dev/zero of=TEST bs=4k count=512000
or
# time dd if=/dev/zero of=blah.out oflag=direct bs=256M count=1
linux/linux-commands/fs-man.txt · Last modified: by 127.0.0.1