I'm going to set up a new laptop system soonish (more on that later) which shall have a completely encrypted hard drive. Hence, I'm testing a few setups wrt security, performance, manageability and fault-tolerance.
Here's a few performance tests I did on an 80 GB laptop hard drive (in an Intel Celeron based laptop, 1.7 GHz, 256 MB RAM, Linux 2.6.17, Debian unstable).
I ran bonnie++ (with no options) and hdparm as hdparm -tT /dev/hda each time. I haven't put too much thought into the test setup, so if I made some stupid mistakes, please let me know.
Unencrypted plain ext3 partitions:
bonnie++:
Version 1.03 ------Sequential Output------ --Sequential Input- --Random-
-Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP /sec %CP
forest 432M 19857 84 21831 10 9536 4 16355 58 22165 3 148.8 0
------Sequential Create------ --------Random Create--------
-Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
files /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP
16 1650 98 +++++ +++ +++++ +++ 1734 98 +++++ +++ 3820 96
forest,432M,19857,84,21831,10,9536,4,16355,58,22165,3,148.8,0,16,1650,98,+++++,
+++,+++++,+++,1734,98,+++++,+++,3820,96
bonnie++ with SELinux:
Version 1.03 ------Sequential Output------ --Sequential Input- --Random-
-Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP /sec %CP
forest 432M 20321 90 21036 13 9473 5 16742 61 21978 4 148.1 0
------Sequential Create------ --------Random Create--------
-Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
files /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP
16 1398 98 +++++ +++ +++++ +++ 1473 98 +++++ +++ 3305 98
forest,432M,20321,90,21036,13,9473,5,16742,61,21978,4,148.1,0,16,1398,98,+++++,
+++,+++++,+++,1473,98,+++++,+++,3305,98
hdparm:
Timing cached reads: 1416 MB in 2.00 seconds = 707.48 MB/sec Timing buffered disk reads: 82 MB in 3.06 seconds = 26.80 MB/sec
hdparm with SELinux:
Timing cached reads: 1404 MB in 2.00 seconds = 700.59 MB/sec Timing buffered disk reads: 80 MB in 3.02 seconds = 26.53 MB/sec
Ext3 partitions on top of LVM on top of dm-crypt:
bonnie++:
Version 1.03 ------Sequential Output------ --Sequential Input- --Random-
-Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP /sec %CP
forest 464M 11149 54 16660 20 6461 5 7472 58 11129 5 136.4 0
------Sequential Create------ --------Random Create--------
-Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
files /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP
16 1564 98 +++++ +++ +++++ +++ 1650 98 +++++ +++ 2640 97
forest,464M,11149,54,16660,20,6461,5,7472,58,11129,5,136.4,0,16,1564,98,+++++,
+++,+++++,+++,1650,98,+++++,+++,2640,97
bonnie++ with SELinux:
Version 1.03 ------Sequential Output------ --Sequential Input- --Random-
-Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP /sec %CP
forest 464M 9878 52 12138 11 5457 6 6834 56 11037 5 137.2 0
------Sequential Create------ --------Random Create--------
-Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
files /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP
16 1426 97 +++++ +++ +++++ +++ 1451 98 +++++ +++ 2433 97
forest,464M,9878,52,12138,11,5457,6,6834,56,11037,5,137.2,0,16,1426,97,+++++,
+++,+++++,+++,1451,98,+++++,+++,2433,97
hdparm:
Timing cached reads: 1408 MB in 2.00 seconds = 704.01 MB/sec Timing buffered disk reads: 80 MB in 3.02 seconds = 26.53 MB/sec
hdparm with SELinux:
Timing cached reads: 1396 MB in 2.00 seconds = 698.06 MB/sec Timing buffered disk reads: 82 MB in 3.07 seconds = 26.69 MB/sec
So yes, there is some overhead, but it's nothing too serious, IMHO. And quite honestly, I don't care too much about performance here — security is more important than performance. I think you'll agree; if you don't agree now, you will agree with me on the very day someone steals your laptop ;-)
Enough spamming, back to work.
A while ago I wanted to enlarge my /home partition (hda6), as it was getting full. After that partition I had another (unused) one, which I intended to merge with hda6 and thereby increase the amount of free disk space on /home.
Here's parts of the disk layout:
hda6 Logical Linux ext3 30848.00
hda7 Logical Linux ext3 8848.00
So, merging hda7 into hda6 should be as simple as removing hda7, and then resizing hda6 to swallow up the 8 gig from the former hda7. Basically, that's how it worked, but I had a few problems. First, at that time is seemed impossible to simply resize ext3 partitions. Neither ext2resize, nor QtParted, nor parted worked for me for some reasons (maybe that has changed recently).
After some googling I finally found a way to do it (which I'll document here, maybe it'll be helpful for others):
fsck on both, hda6 and hda7 (optional?)cfdisk)# tune2fs -O^has_journal /dev/hda6
parted. The xxxx is the original start of hda6 (you may not change that) and yyyy is the end of the disk:# parted(parted) resize 6 xxxxx yyyyy
tune2fs -j /dev/hda6
But this didn't work from the beginning either — for some strage reason parted didn't believe me that the space after hda6 was free. It did display it as free space, but the "resize" operation complained.
So what I did was this (instead af the above step 3):
cfdiskparted, and remove hda7 again from within parted(!):# parted(parted) rm 7
It seems parted didn't like the way cfdisk removed the hda7 partition... very strange...
Recent comments
21 weeks 1 day ago
47 weeks 2 days ago
1 year 2 weeks ago
1 year 3 weeks ago
1 year 3 weeks ago