Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Arch Linux
infrastructure
Commits
77d5e474
Verified
Commit
77d5e474
authored
Jun 17, 2020
by
Sven-Hendrik Haase
Browse files
install_arch: Fix to work with both NVME and SATA drives
parent
80b4f761
Pipeline
#242
passed with stage
in 1 minute and 13 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
roles/install_arch/tasks/main.yml
View file @
77d5e474
...
...
@@ -24,15 +24,15 @@
changed_when
:
"
sgdisk.rc
==
0"
-
name
:
partition and format the disks (btrfs RAID)
command
:
mkfs.btrfs -f -L root -d {{ raid_level|default('raid1') }} -m {{ raid_level|default('raid1') }} -O no-holes {{ system_disks | map('regex_replace', '^(.*)$', '\
1p
2') | join(' ') }}
when
:
filesystem == "btrfs" and system_disks|length
=
=
2
command
:
mkfs.btrfs -f -L root -d {{ raid_level|default('raid1') }} -m {{ raid_level|default('raid1') }} -O no-holes {{ system_disks | map('regex_replace', '^(.*)$', '\
g<1>p2' if 'nvme' in system_disks[0] else '\g<1>
2') | join(' ') }}
when
:
filesystem == "btrfs" and system_disks|length
>
=
2
-
name
:
partition and format the disks (btrfs single)
command
:
mkfs.btrfs -f -L root -d single -m single -O no-holes {{ system_disks[0] }}
p2
command
:
mkfs.btrfs -f -L root -d single -m single -O no-holes {{ system_disks[0] }}
{{ 'p2' if 'nvme' in system_disks[0] else '2' }}
when
:
filesystem == "btrfs" and system_disks|length ==
1
-
name
:
create MDADM array
command
:
mdadm --create --level=1 --raid-devices=2 --run /dev/md0 {{ system_disks | map('regex_replace', '(.*)', '
^\1p2$
') | join(' ') }}
command
:
mdadm --create --level=1 --raid-devices=2 --run /dev/md0 {{ system_disks | map('regex_replace', '
^
(.*)
$
', '
\g<1>p2' if 'nvme' in system_disks[0] else '\g<1>2
') | join(' ') }}
when
:
filesystem != "btrfs" and system_disks|length ==
2
-
name
:
format the MDADM array
...
...
@@ -40,7 +40,7 @@
when
:
filesystem != "btrfs" and system_disks|length ==
2
-
name
:
mount the filesystem (btrfs)
mount
:
src="{{ system_disks[0] }}
p2
" path=/mnt state=mounted fstype=btrfs opts="compress=zstd,space_cache=v2"
mount
:
src="{{ system_disks[0] }}
{{ 'p2' if 'nvme' in system_disks[0] else '2' }}
" path=/mnt state=mounted fstype=btrfs opts="compress=zstd,space_cache=v2"
when
:
filesystem == "btrfs"
-
name
:
mount the filesystem (ext4 RAID)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment