个人工具

“UbuntuHelp:UbiquityEncryptedFilesystems”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
(新页面: {{From|https://help.ubuntu.com/community/UbiquityEncryptedFilesystems}} {{Languages|UbuntuHelp:UbiquityEncryptedFilesystems}} == LVM/luks-crypto support with the Ubuntu desktop CD == The ...)
 
 
(未显示同一用户的2个中间版本)
第1行: 第1行:
 
{{From|https://help.ubuntu.com/community/UbiquityEncryptedFilesystems}}
 
{{From|https://help.ubuntu.com/community/UbiquityEncryptedFilesystems}}
 
{{Languages|UbuntuHelp:UbiquityEncryptedFilesystems}}
 
{{Languages|UbuntuHelp:UbiquityEncryptedFilesystems}}
== LVM/luks-crypto support with the Ubuntu desktop CD ==
+
#title LVM/luks-crypto support with the Ubuntu desktop CD
 +
{|border="1" cellspacing="0"
 +
| {i} Please refer to [[UbuntuHelp:EncryptedFilesystems|EncryptedFilesystems]] for further documentation.
 +
|}
 
The Desktop CD installer (ubiquity) currently does not provide support for setting up LVM or encrypted partitions. With the recipe below, the Desktop CD can be used to install Ubuntu on a previously created (optionally encrypted) LVM.
 
The Desktop CD installer (ubiquity) currently does not provide support for setting up LVM or encrypted partitions. With the recipe below, the Desktop CD can be used to install Ubuntu on a previously created (optionally encrypted) LVM.
 
* Boot desktop CD, open terminal, and install missing packages:
 
* Boot desktop CD, open terminal, and install missing packages:
<pre><nowiki>apt-get install cryptsetup lvm2
+
<pre><nowiki>
 +
apt-get install cryptsetup lvm2
 
sudo modprobe dm-crypt</nowiki></pre>
 
sudo modprobe dm-crypt</nowiki></pre>
 
* Now set up the LVM and crypto partitions with the command line tools. If you already have Ubuntu installed on a standard LVM-on-LUKS, this is as easy as:
 
* Now set up the LVM and crypto partitions with the command line tools. If you already have Ubuntu installed on a standard LVM-on-LUKS, this is as easy as:
<pre><nowiki>sudo cryptsetup luksOpen /dev/sda4 sda4_crypt
+
<pre><nowiki>
 +
sudo cryptsetup luksOpen /dev/sda4 sda4_crypt
 
</nowiki></pre>
 
</nowiki></pre>
 
or whichever partition is the encrypted LVM PV. This should automatically create the LVM LVs in `/dev/mapper/`.
 
or whichever partition is the encrypted LVM PV. This should automatically create the LVM LVs in `/dev/mapper/`.
 
* Start ubiquity with manual partitioning, and use the existing
 
* Start ubiquity with manual partitioning, and use the existing
partitions; keep `/home` etc. as they are, and reformat the root
+
partitions; keep `/home`, `boot`, etc. as they are, but make sure they are marked appropriately.  For example, if your old system had a `/home` partition that was ext3, mark that partition as ext3 instead of unused and be sure to set its mount point to `/home`.  Do the same the root (`/`) and boot (`/boot`)
partition in the LVM. '''Do not reboot''' immediately, your system will not boot!
+
partitions in the LVM, but mark them for reformatting as well. '''Do not mark your `/home` partition for reformatting''' if you want to keep its contents. '''Do not reboot''' immediately, your system will not boot!
 
* Mount the newly installed target system:
 
* Mount the newly installed target system:
<pre><nowiki>sudo mount /dev/mapper/ubuntu*-root /mnt
+
<pre><nowiki>
 +
sudo mount /dev/mapper/ubuntu*-root /mnt
 
sudo chroot /mnt mount /proc
 
sudo chroot /mnt mount /proc
 
sudo mount --bind /dev /mnt/dev
 
sudo mount --bind /dev /mnt/dev
 
sudo chroot /mnt mount /boot</nowiki></pre>
 
sudo chroot /mnt mount /boot</nowiki></pre>
* Create an appropriate crypttab:
+
* Create an appropriate crypttab.
<pre><nowiki>echo "sda4_crypt UUID=`sudo vol_id --uuid /dev/sda4` none luks" | sudo tee -a /mnt/etc/crypttab
+
<pre><nowiki>
 +
echo "sda4_crypt UUID=`sudo blkid -p /dev/sda4 | cut --delimiter='\"' -f 2` none luks" | sudo tee -a /mnt/etc/crypttab
 
</nowiki></pre>
 
</nowiki></pre>
 
* Install a few missing packages into the target system (this will
 
* Install a few missing packages into the target system (this will
 
also take care of updating the initramfs):
 
also take care of updating the initramfs):
<pre><nowiki>sudo chroot /mnt apt-get install cryptsetup lvm2 dmsetup
+
<pre><nowiki>
 +
sudo chroot /mnt apt-get install cryptsetup lvm2 dmsetup
 
</nowiki></pre>
 
</nowiki></pre>
 
* Unmount the target system:
 
* Unmount the target system:
<pre><nowiki>sudo umount /mnt/proc /mnt/dev /mnt/boot /mnt
+
<pre><nowiki>
 +
sudo umount /mnt/proc /mnt/dev /mnt/boot /mnt
 
</nowiki></pre>
 
</nowiki></pre>
 
* Reboot into your newly installed system.
 
* Reboot into your newly installed system.
  
 
[[category:UbuntuHelp]]
 
[[category:UbuntuHelp]]

2010年5月20日 (四) 00:26的最新版本

  1. title LVM/luks-crypto support with the Ubuntu desktop CD
{i} Please refer to EncryptedFilesystems for further documentation.

The Desktop CD installer (ubiquity) currently does not provide support for setting up LVM or encrypted partitions. With the recipe below, the Desktop CD can be used to install Ubuntu on a previously created (optionally encrypted) LVM.

  • Boot desktop CD, open terminal, and install missing packages:
apt-get install cryptsetup lvm2
sudo modprobe dm-crypt
  • Now set up the LVM and crypto partitions with the command line tools. If you already have Ubuntu installed on a standard LVM-on-LUKS, this is as easy as:
sudo cryptsetup luksOpen /dev/sda4 sda4_crypt

or whichever partition is the encrypted LVM PV. This should automatically create the LVM LVs in `/dev/mapper/`.

  • Start ubiquity with manual partitioning, and use the existing

partitions; keep `/home`, `boot`, etc. as they are, but make sure they are marked appropriately. For example, if your old system had a `/home` partition that was ext3, mark that partition as ext3 instead of unused and be sure to set its mount point to `/home`. Do the same the root (`/`) and boot (`/boot`) partitions in the LVM, but mark them for reformatting as well. Do not mark your `/home` partition for reformatting if you want to keep its contents. Do not reboot immediately, your system will not boot!

  • Mount the newly installed target system:
sudo mount /dev/mapper/ubuntu*-root /mnt
sudo chroot /mnt mount /proc
sudo mount --bind /dev /mnt/dev
sudo chroot /mnt mount /boot
  • Create an appropriate crypttab.
echo "sda4_crypt UUID=`sudo blkid -p /dev/sda4 | cut --delimiter='\"' -f 2` none luks" | sudo tee -a /mnt/etc/crypttab
  • Install a few missing packages into the target system (this will

also take care of updating the initramfs):

sudo chroot /mnt apt-get install cryptsetup lvm2 dmsetup
  • Unmount the target system:
sudo umount /mnt/proc /mnt/dev /mnt/boot /mnt
  • Reboot into your newly installed system.