NotQuiteSane Guru
Joined: 30 Jan 2005 Posts: 488 Location: Klamath Falls, Jefferson, USA, North America, Midgarth
|
Posted: Fri Jul 29, 2005 9:33 am Post subject: HOWTO: enlarge an encrypted LVM partition |
|
|
I. Intro
This how to will explain how to enlarge an encrypted LVM partition.
II. Why this howto?
A search of the forums and google did not give any information on resizing. I then decided to create this howto
III. Assumptions
It is assumed that you already are familiar with LVM and creating an encrypted device
IV. Variables
The following variables apply to my system, they may differ on your system
I use:
1.reiserfs v.3.6.19
2.gentoo for my volume group name
3.serpent for crypto algorithm
4.miverna is the hostname
V. Persons responsible for what happens to your computer
That would be you. Neither I, the administrators / moderators of these forums, the Dali Lama, Santa Claus, nor anyone else can be held responsible for what you do to your computer nor what someone who has physical access to root on your box does
You should:
1.Read the entire howto before doing anything
2.Make a backup at least of the partition in question
3.Test backup
4.Create a encrypted partition and experiment with it first until you are comfortable with the process
VI. What this howto does not include
1.Shrinking an encrypted partition
a. It is assumed few, if any will need this
b. It may be added later
2.How to create an encrypted partition
VII. Enlarging an encrypted partition
0.Do you have a backup? If not, go make one
1.Drop into single user mode
This may not be needed, but I prefer to use it when working with the file system
2.What is the current size of the partition we wish to resize?
Code: | miverna ~ # df -h /music/
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/music 5.0G 1.4G 3.7G 28% /music |
3. Is there space avadiable?
Code: | miverna ~ # vgdisplay | grep Size
VG Size 56.38 GB
PE Size 4.00 MB
Alloc PE / Size 11520 / 45.00 GB
Free PE / Size 2912 / 11.38 GB |
4. Unmount the partition
Code: | miverna ~ # umount /music/ |
5. Check the partition
Code: | miverna ~ # fsck.reiserfs /dev/mapper/music |
6. Remove the encrypted device
Code: | miverna ~ # cryptsetup remove music |
7. Expand the logical volume
Code: | miverna ~ # lvresize -L+1G /dev/gentoo/music
Extending logical volume music to 6.00 GB
Logical volume music successfully resized |
8. Create the encrypted device
Code: | miverna ~ # cryptsetup -c serpent create music /dev/gentoo/music
Enter passphrase: |
9. Resize the file system
Code: | miverna ~ # resize_reiserfs /dev/mapper/music
resize_reiserfs 3.6.19 (2003 www.namesys.com)
ReiserFS report:
blocksize 4096
block count 1572864 (1310720)
free blocks 1214793 (952657)
bitmap block count 48 (40)
Syncing..done
resize_reiserfs: Resizing finished successfully. |
10. Resize the device
Code: | miverna ~ # cryptsetup resize music |
11. Mount the device
Code: | miverna ~ # mount /dev/mapper/music /music/ |
12. Verify the size of the partition
Code: | miverna ~ # df -h /music/
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/music 6.0G 1.4G 4.7G 23% /music |
Thats it. You are done now.
VIII. Authors & contact
1. NotQuiteSane nqs at tigger dot tmcom dot com
IX. Version and change log
1. 0.1 29. July 2005 02:27 creation
2. 0.1.1 29. July 2005 02:36 minor grammatical correction _________________ These opinions are mine, mine I say! Piss off and get your own.
As I see it -- An irregular blog, Improved with new location
To delete French language packs from system use 'sudo rm -fr /' |
|