Last active
August 29, 2015 13:56
-
-
Save yitsushi/9157613 to your computer and use it in GitHub Desktop.
Vagy csinalhatsz virtualis filerendszereket amiket titkositasz... A lenti példa végigviszi hogyan tudsz csinálni lvm csoportokat. Itt most létrehozok 2x300 megát, amiket összekapcsolok egy lvm csoportba és úgy használom. Ezen végül lehet akár titkosított a fájlrendszer is. Elég ezeket a kis fájlokat lementeni, amit kicsit könnyebb mint modjuk eg…
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
root@yitsushi:~# dd if=/dev/zero of=myfilesystem.1 bs=1M count=300 | |
300+0 records in | |
300+0 records out | |
314572800 bytes (315 MB) copied, 1.67623 s, 188 MB/s | |
root@yitsushi:~# dd if=/dev/zero of=myfilesystem.2 bs=1M count=300 | |
300+0 records in | |
300+0 records out | |
314572800 bytes (315 MB) copied, 1.40912 s, 223 MB/s | |
root@yitsushi:~# mke2fs -j myfilesystem.1 | |
mke2fs 1.42 (29-Nov-2011) | |
myfilesystem.1 is not a block special device. | |
Proceed anyway? (y,n) y | |
Discarding device blocks: done | |
Filesystem label= | |
OS type: Linux | |
Block size=1024 (log=0) | |
Fragment size=1024 (log=0) | |
Stride=0 blocks, Stripe width=0 blocks | |
76912 inodes, 307200 blocks | |
15360 blocks (5.00%) reserved for the super user | |
First data block=1 | |
Maximum filesystem blocks=67633152 | |
38 block groups | |
8192 blocks per group, 8192 fragments per group | |
2024 inodes per group | |
Superblock backups stored on blocks: | |
8193, 24577, 40961, 57345, 73729, 204801, 221185 | |
Allocating group tables: done | |
Writing inode tables: done | |
Creating journal (8192 blocks): done | |
Writing superblocks and filesystem accounting information: done | |
root@yitsushi:~# mke2fs -j myfilesystem.2 | |
mke2fs 1.42 (29-Nov-2011) | |
myfilesystem.2 is not a block special device. | |
Proceed anyway? (y,n) y | |
Discarding device blocks: done | |
Filesystem label= | |
OS type: Linux | |
Block size=1024 (log=0) | |
Fragment size=1024 (log=0) | |
Stride=0 blocks, Stripe width=0 blocks | |
76912 inodes, 307200 blocks | |
15360 blocks (5.00%) reserved for the super user | |
First data block=1 | |
Maximum filesystem blocks=67633152 | |
38 block groups | |
8192 blocks per group, 8192 fragments per group | |
2024 inodes per group | |
Superblock backups stored on blocks: | |
8193, 24577, 40961, 57345, 73729, 204801, 221185 | |
Allocating group tables: done | |
Writing inode tables: done | |
Creating journal (8192 blocks): done | |
Writing superblocks and filesystem accounting information: done | |
root@yitsushi:~# file myfilesystem.* | |
myfilesystem.1: Linux rev 1.0 ext3 filesystem data, UUID=44ac0731-5e75-48c8-94c3-3b863d6ddccd | |
myfilesystem.2: Linux rev 1.0 ext3 filesystem data, UUID=b77eaf90-d20d-40f9-a78c-0854965196d3 | |
root@yitsushi:~# losetup -sf myfilesystem.1 | |
/dev/loop0 | |
root@yitsushi:~# losetup -sf myfilesystem.2 | |
/dev/loop1 | |
root@yitsushi:~# losetup -a | |
/dev/loop0: [fd00]:1193129 (/root/myfilesystem.1) | |
/dev/loop1: [fd00]:1193092 (/root/myfilesystem.2) | |
root@yitsushi:~# pvcreate /dev/loop0 | |
Physical volume "/dev/loop0" successfully created | |
root@yitsushi:~# vgcreate myfiles /dev/loop0 | |
Volume group "myfiles" successfully created | |
root@yitsushi:~# lvcreate -L250M myfiles | |
Rounding up size to full physical extent 252.00 MiB | |
Logical volume "lvol0" created | |
root@yitsushi:~# mkfs.ext3 /dev/myfiles/lvol0 | |
mke2fs 1.42 (29-Nov-2011) | |
Discarding device blocks: done | |
Filesystem label= | |
OS type: Linux | |
Block size=1024 (log=0) | |
Fragment size=1024 (log=0) | |
Stride=0 blocks, Stripe width=0 blocks | |
64512 inodes, 258048 blocks | |
12902 blocks (5.00%) reserved for the super user | |
First data block=1 | |
Maximum filesystem blocks=67371008 | |
32 block groups | |
8192 blocks per group, 8192 fragments per group | |
2016 inodes per group | |
Superblock backups stored on blocks: | |
8193, 24577, 40961, 57345, 73729, 204801, 221185 | |
Allocating group tables: done | |
Writing inode tables: done | |
Creating journal (4096 blocks): done | |
Writing superblocks and filesystem accounting information: done | |
root@yitsushi:~# vgextend myfiles /dev/loop1 | |
No physical volume label read from /dev/loop1 | |
Physical volume "/dev/loop1" successfully created | |
Volume group "myfiles" successfully extended | |
root@yitsushi:~# lvextend -L+300M /dev/myfiles/lvol0 | |
Extending logical volume lvol0 to 552.00 MiB | |
Logical volume lvol0 successfully resized | |
root@yitsushi:~# resize2fs /dev/myfiles/lvol0 | |
resize2fs 1.42 (29-Nov-2011) | |
Resizing the filesystem on /dev/myfiles/lvol0 to 565248 (1k) blocks. | |
The filesystem on /dev/myfiles/lvol0 is now 565248 blocks long. | |
root@yitsushi:~# mkdir /secret | |
root@yitsushi:~# mount /dev/myfiles/lvol0 /secret/ | |
root@yitsushi:~# df -h | |
Filesystem Size Used Avail Use% Mounted on | |
.... .... .... | |
.... .... .... | |
/dev/mapper/myfiles-lvol0 535M 6.3M 501M 2% /secret | |
root@yitsushi:~# |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment