Hi,
I would like to start by saying that this is by no means a howto.
I made this post just as an explanation of an update and strategy I use on a Hold pc I have that I don’t want to reconfigure completely with a most uptodate setup on OpenSuSE 12.3 (OS).
So I will retain the current partitions on disk.
The scenario is the following one:
Old pc with 3 ext3 partitions encrypted with luks. One of them root / !
The Pc is like this since version 10.3 (I think) OpenSuSE ( latter version 10 then upgraded until to 11.4 … and now from 11.4 to 12.3 always the same method …fresh install.
So the strategy is the following … install All Fresh on he disk Preserving Only the current /home.
- install is done on the only NON-Encrypted partition on disk so that I can reconfigure and rsync the / partition to an encrypted one and boot with a encrypted / and all others on disk Just like the initial install.
I always followed the first method since early 9 version (yes version 9 …history on the making !!) to installs on root encrypted filesystems. Now a deprecated process …
SDB:Encrypted root file system (deprecated) - openSUSE
The setup I have is the following:
This also serves the purpose of documenting a migration I made some Months ago from old 11.4 laptops with encrypted partititions.
Sharing is gaining.
This process is also explained on:
https://forums.opensuse.org/english/get-technical-help-here/install-boot-login/488393-11-1-11-4-12-3-luks-encryption.html
it is a bit of redundancy but this tiem I am a bit more clear about the all process.
Initial configuration:
**/dev/sda1 ext3 /boot
/dev/sda2 swap encrypted with Luks
/dev/sda3 / ext3 encrypted with Luks
/dev/sda4 /var ext3 un-encrypted filesystem
/dev/sdb1 ext3 /home encrypted with Luks
**During install we will make a partition setup with ONLY two partitions
-> /dev/sda1 ext3 Non encrypted /boot
-> /dev/sda4 ext3 Non encerypted /
note : A usb based hdd can be used as a temporary / for this fresh install if no partition is available on the hdd.
Upon install I choose to setup the partitions and then the expert mode to make the above partitions scheme.
I also chose the option to format Both partitions.
This will be the only two partitions on the new install from DVD. The installer complainst about not having swap …ignore it.
After that I simply choose a KDE desktop basic install and let the install proceed.
After the first boot I start to open the encrypted filesystem with:
as root execute:
cryptsetup -v luksOpen /dev/sda3 root
cryptsetup -v luksOpen /dev/sda2 swap
cryptsetup -v luksOpen /dev/sdb1 home
then I make swapon on now opened older swap.
swapon /dev/mapper/swap
I then Mount both /home and /root.
mkdir /mnt/root
mount -t ext3 /dev/mapper/root /mnt/root
mkdir /mnt/home
mount -t ext3 /dev/mapper/home /mnt/home
From the documentation it is obvious that Systemd now handles all the encryption so it is only crucial when installing on and old luks encrypted partition that the mkinitrd let’s the kernel “know” about the root encrypted partition.
And that we make a crypttab file according to what we have in the disk.
So that preparing the next boot on the initial configuration i will make /etc/fstab and /etc/crypttab contain the intial partition setup also to make mkinitrd work accordingly.
so editing /etc/fsab to look like :
/dev/mapper/root / ext3 acl,user_xattr 1 1
/dev/mapper/swap swap swap defaults 0 0
/dev/mapper/home /home ext3 acl,user_xattr 1 2
note : Place a # in front of / and /boot current lines … if something goes wrong you can still boot the current fresh install as is.
Editing the /etc/crypttab:
root /dev/sda3 none luks
home /dev/sdb1 none luks
swap /dev/sda2 none luks
Now with this files edited I update the initrd:
mkinitrd -d /dev/mapper/root
And now the final most important step: copy the current / with all changes on /etc/fstab and /etc/crypttab the the initial partition where it should be to maintain the initial partition setup:
first erase all previous /mnt/root
rm -rf /mnt/root/*
the rsync both:
cd /
rsync -AHSXax / /mnt/root/
wait until it is over and reboot …
The first reboot I had the system did ask me for the password but somehow he could not boot.
Then I shutdwon the pc and reboot it again and: Voilá! It worked!
After that I then made the necessary changes like updating all software, kernel inclusive and adding the remaining user and the previous version had (by he same order …uid number the same)
And add all Software missing …
All Fresh all Desktop environment was almost the same …same windows, same desktops, same app’s oppened … same Firefox windows …
the advantage of this update is that is allows for the same desktop environment to remain from one OS to the next …even if like in this case from 11.4 to 12.3!
Regards.