• Drives appearing as external/removable drives?


    Heyya

    I just recently installed a couple of drives two 320gb drives and a 160gb drive before a fresh install of Antergos with my system installed on a separate 240gb SSD. When I open nautilus for the first time time after a restart they are unmounted, after clicking on them I have to type in my user login before they become usable, (because they’re treated as an external drive I assume) and I’ve only managed to make it so that I can use the first 320gb drive normally after mounting it but with that solution I can only use the drive after I mount it which is more tedious and unnecessary than I’d like. I’ve tried googling, but I lack the vocabulary to figure out how to do what exactly I’m trying to do well.

    I’m trying to make it so that that the disk is mounted maybe during decryption on startup or after login, so that the drive is ready to go and not treated as an external drive. So that Bittorrent Sync or any other service is able to use it seamlessly. I have the 240gb boot drive under full disk encryption, I’d like to encrypt the other drives as well.

    Anyone with more experienced have any suggestions about how I could configure it this way?

    Thanks all!

  • Anyone have experience with “autofs?” https://wiki.archlinux.org/index.php/Autofs Can it be configured to work with an encrypted drive?

    I also found a method for Ubuntu, and I have no scripting experience yet, so I don’t know how compatible this would be with Antergos/arch . Here: http://askubuntu.com/questions/103835/securely-automount-encrypted-drive-at-user-login The post is also like 3 years old.

    It seems the above post is basically what I’d like to do. Make it so that my drives mount automatically after login, presumably after I’ve logged in and only after my SSD has been decrypted on startup. The encrypted passphrase being stored on the SSD.

    Continuing my search…

  • @anterghost : Are those drives also encrypted? If the answer is no, simply add them to your /etc/fstab file. If they’re encrypted check this out: https://wiki.archlinux.org/index.php/Dm-crypt/System_configuration#crypttab

    Cheers!

  • I guess editing /etc/crypttab and /etc/fstab is my answer. I’ve just reformatted all my secondary drives and changed their partition tables to GPT, as well as setting up LUKS and ext4 on all of them.

    I’ve been looking at different guides and it’s a bit complicated at least at first, so I hope you don’t mind me asking more questions and I’ve edited my reply a couple of times to make my questions better. I’m a little hesitant to edit the /etc/crypttab and /etc/fstab files just yet, as I don’t want to make my system unbootable again.

    From what the arch wiki say I’m assuming I’ll have to add this to /etc/crypttab? (with the corrected UUIDs):

     # 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
     # secondarydrive1         UUID=2f9a8428-ac69-478a-88a2-4aa458565431        none    luks,timeout=180
     # secondarydrive2         UUID=2f9a8428-ac69-478a-88a2-4aa458565431        none    luks,timeout=180
     # secondarydrive3         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/secondarydrive1      /dev/sdb               ext4    defaults,errors=remount-ro  0  2
     /dev/mapper/secondarydrive2      /dev/sdc               ext4    defaults,errors=remount-ro  0  2
     /dev/mapper/secondarydrive3      /dev/sdd               ext4    defaults,errors=remount-ro  0  2
    

    Thanks again for the help!

  • I decided to try doing it anyway. Luckily it made my system go into emergency mode. I logged in as root and was able to:

     nano /etc/crypttab
    
     nano /etc/fstab
    

    And remove the new entries to make the system bootable again. Here’s what I tried that made my system failed to boot. Anyone reading can file these under, what not to do.

    /etc/crypttab:

     # sdb1         UUID=31776cb9-069f-418f-84fa-22ce882c30b8        none    luks,timeout=180
     # sdc1         UUID=3ec3ab06-df1b-416e-85b7-af1562aa3dc5        none    luks,timeout=180
     # sdd1         UUID=f66099ba-8ce6-4a5d-92c3-58dae90456ad        none    luks,timeout=180
    

    /etc/fstab:

     /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
    

    And /etc/fstab (As the Fedora wiki suggested… using the luks UUID instead of the name in /etc/crypttab):

     /dev/mapper/luks-31776cb9-069f-418f-84fa-22ce882c30b8      /dev/sdb               ext4    defaults,errors=remount-ro  0  2
     /dev/mapper/luks-3ec3ab06-df1b-416e-85b7-af1562aa3dc5      /dev/sdc               ext4    defaults,errors=remount-ro  0  2
     /dev/mapper/luks-f66099ba-8ce6-4a5d-92c3-58dae90456ad      /dev/sdd               ext4    defaults,errors=remount-ro  0  2
    

    Finally, I also tried:

     /dev/mapper/luks-UUID=31776cb9-069f-418f-84fa-22ce882c30b8      /dev/sdb               ext4    defaults,errors=remount-ro  0  2
     /dev/mapper/luks-UUID=3ec3ab06-df1b-416e-85b7-af1562aa3dc5      /dev/sdc               ext4    defaults,errors=remount-ro  0  2
     /dev/mapper/luks-UUID=f66099ba-8ce6-4a5d-92c3-58dae90456ad      /dev/sdd               ext4    defaults,errors=remount-ro  0  2
    

    After trying these methods my machine spit:

     [ TIME ] Timed out waiting for device dev-mapper-sdb1
     [DEPEND] Dependency failed for File System Check on /dev/mapper/sdb1.
     [DEPEND] Dependency failed for /dev/sdb.
     [DEPEND] Dependency failed for Local File Systems.
     [ TIME ] Timed out waiting for device dev-mapper-sdd1.
     [DEPEND] Dependency failed for File System Check on /dev/mapper/sdd1.
     [DEPEND] Dependency failed for /dev/sdd.
     [ TIME ] Timed out waiting for device dev-mapper-sdc1.
     [DEPEND] Dependency failed for File System Check on /dev/mapper/sdc1. 
     [DEPEND] Dependency failed for /dev/sdc.
    

    What am I doing wrong? It must be just syntax…

  • @anterghost Sorry but your files are wrong.

    Your /etc/crypttab should look like this:
    externaldrive UUID=2f9a8428-ac69-478a-88a2-4aa458565431 none luks,timeout=180

    Where externaldrive is a name you’ll use later in fstab, so in /etc/fstab:
    /dev/mapper/externaldrive /mnt/backup ext4 defaults,errors=remount-ro 0 2

    See? You use externaldrive to refer to your now open Luks device. /mnt/backup is where it will mount it, so you can access to it in that directory (it must be created by you).

    In your examples:
    /etc/crypttab (remove all #'s!): (*)

    sdb1         UUID=31776cb9-069f-418f-84fa-22ce882c30b8        none    luks,timeout=180
    sdc1         UUID=3ec3ab06-df1b-416e-85b7-af1562aa3dc5        none    luks,timeout=180
    sdd1         UUID=f66099ba-8ce6-4a5d-92c3-58dae90456ad        none    luks,timeout=180
    

    And your fstab:

    /dev/mapper/sdb1      /mnt/data1               ext4    defaults,errors=remount-ro  0  2
    /dev/mapper/sdc1      /mnt/data2               ext4    defaults,errors=remount-ro  0  2
    /dev/mapper/sdd1      /nnt/data3               ext4    defaults,errors=remount-ro  0  2
    

    Of course, data1, data2 and data3 are just examples, you can use the names you prefer (but remember to create the directories first with mkdir)

    Cheers!

    (*) I’ve never tried to use sdb1, sdc1 as LUKS names, I don’t know if this can cause problems or not.

Posts 6Views 1277
Log in to reply