diff options
| author | Guilhem Moulin <guilhem@fripost.org> | 2014-01-23 07:40:58 +0100 | 
|---|---|---|
| committer | Guilhem Moulin <guilhem@fripost.org> | 2015-06-07 04:27:58 +0200 | 
| commit | 16e2c85922848adb1c21a46a6cc23846ef94b951 (patch) | |
| tree | 740413af17c446acf4478ed7e176caa881bdcf9e /src/fripost-partman-udeb | |
| parent | ba40cbca9650e1ddaa8357c21b5de31cc376c481 (diff) | |
Enable RAID root system.
Quoting /usr/share/doc/cryptsetup/README.keyctl :
    The current state for dm-crypt in Linux is that it is single threaded, thus
    every dm-crypt mapping only uses a single core for crypto operations.  To
    use the full power of your many-core processor it is thus necessary to
    split the dm-crypt device. For Linux software raid arrays the easiest
    segmentation is to just put the dm-crypt layer below the software raid
    layer.
However, this seems no longer true since 2.6.38, cf.
  http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=714806
  https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=c029772125594e31eb1a5ad9e0913724ed9891f2
  http://kernelnewbies.org/Linux_2_6_38#head-49f5f735853f8cc7c4d89e5c266fe07316b49f4c
Therefore encrypting the array (instead of assembling an array of encrypted
disks) shouldn't cause a performance cost. Also, it makes the ramdisk much
easier to configure :-)
Diffstat (limited to 'src/fripost-partman-udeb')
| -rw-r--r-- | src/fripost-partman-udeb/base.sh | 16 | 
1 files changed, 16 insertions, 0 deletions
| diff --git a/src/fripost-partman-udeb/base.sh b/src/fripost-partman-udeb/base.sh index b6770f8..976cfb6 100644 --- a/src/fripost-partman-udeb/base.sh +++ b/src/fripost-partman-udeb/base.sh @@ -586,3 +586,19 @@ getIPv4() {      $ip -4 address show dev "$if" scope global \      | sed -nr '/^\s+inet\s([[:xdigit:].:]{3,39}).*/ {s//\1/p;q}'  } + + + +############################################################################## +# Remove a partition from a device +# +# Usage: fripost_rmpart device partition + +fripost_rmpart () { +    local device="$1" part="$2" +    n=$( /sbin/parted -sm "$device" p +       | sed -nr "/^[0-9].*:$part:[^:]*;$/ s/:.*//p" ) +    [ "$n" ] || return +    log "Removing partition $n ($part) from $device" +    /sbin/parted -sm "$device" rm "$n" +} | 
