Skip to content

Need help adding encrypted drives to /etc/crypttab /etc/fstab

Hey all, I'm new to Arch and am not running full arch yet. I'm running Antergos to try out Arch and switched because I wanted more control out of the box than Ubuntu. Tried Fedora and only found one downside and that is the less widely available packages in my experience. So far I'm loving Arch/Antergos in that it has almost all the programs you'd find on Ubuntu but gives the user complete control by design.

I just recently installed a couple of internal drives and formatted their partition tables the GUI way with gparted and formatted them through nautilus with luks + ext4... The most config file editting I've done so far is with adding multiplib support via nano in command line thanks to the wiki.

I've been reading the wiki and every guide I can find in search engines on how to add these drives to crypttab and fstab setup on boot so that they are automatically mounted by the time I login. Most of the guides are for doing so with a keyfile... I'd like to enter each passphrase at boot for each drive if possible. (I'm assuming that's how it'd work without a keyfile.) But I'm having trouble parsing the wiki on this one... I haven't editted my /etc/crypttab or /etc/fstab files yet, as I don't want to make my system ubootable.

I thought I'd add this to /etc/crypttab (with the correct UUIDs, which I know how to find):

 # crypttab: mappings for encrypted partitions
 #
 # Each mapped device will be created in /dev/mapper, so your /etc/fstab
 # should use the /dev/mapper/<name> paths for encrypted devices.
 #
 # The Arch specific syntax has been deprecated, see crypttab(5) for the
 # new supported syntax.
 #
 # NOTE: Do not list your root (/) partition here, it must be set up
 #       beforehand by the initramfs (/etc/mkinitcpio.conf).
 
 # <name>       <device>                                     <password>              <options>
 # home         UUID=b8ad5c18-f445-495d-9095-c9ec4f9d2f37    /etc/mypassword1
 # data1        /dev/sda3                                    /etc/mypassword2
 # data2        /dev/sda5                                    /etc/cryptfs.key
 # swap         /dev/sdx4                                    /dev/urandom            swap,cipher=aes-cbc-essiv:sha256,size=256
 # vol          /dev/sdb7                                    none
 # sdb1         UUID=2f9a8428-ac69-478a-88a2-4aa458565431        none    luks,timeout=180
 # sdc1         UUID=2f9a8428-ac69-478a-88a2-4aa458565431        none    luks,timeout=180
 # sdd1         UUID=2f9a8428-ac69-478a-88a2-4aa458565431        none    luks,timeout=180

And this to /etc/fstab:

 # /etc/fstab: static file system information.
 #
 # Use 'blkid' to print the universally unique identifier for a
 # device; this may be used with UUID= as a more robust way to name devices
 # that works even if disks are added and removed. See fstab(5).
 #
 # <file system> <mount point>   <type>  <options>       <dump>  <pass>
 #
 UUID=36112662-bb50-47aa-a329-4988893be60b / ext4 defaults,rw,noatime,discard 0 1
 UUID=E30C-F017 /boot/efi vfat defaults,rw,noatime 0 0
 UUID=48648552-69db-457c-9d4c-f6d6f223b317 swap swap defaults 0 0
 UUID=924c83a2-33f8-4df6-b914-9149ae544987 /boot ext2 defaults,rw,noatime 0 0
 tmpfs /tmp tmpfs defaults,noatime,mode=1777 0 0
 /dev/mapper/sdb1      /dev/sdb               ext4    defaults,errors=remount-ro  0  2
 /dev/mapper/sdc1      /dev/sdc               ext4    defaults,errors=remount-ro  0  2
 /dev/mapper/sdd1      /dev/sdd               ext4    defaults,errors=remount-ro  0  2

Sorry if TL;DR and thanks in advance!

1 points2 comments
Open on Reddit
About this post
Posted
Archived
Score
1 · 100% up
Kind
Text
ID
3cusyh

Author

5
posts
27
comments
0
media
View profile

2 comments

Why are your entries in /etc/crypttab commented out? And I don't think you can mount a drive as /dev/sdX…

1 points

If you havent gotten this to work yet its most likely your fstab file.

Its should be /dev/mapper/<crypt_volume> /<mount_point> ext4 <options......etc>

1 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.