LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 05-10-2019, 06:12 AM   #1
Lysander666
Senior Member
 
Registered: Apr 2017
Location: The Underearth
Distribution: Slackware
Posts: 1,506
Blog Entries: 3

Rep: Reputation: 1522Reputation: 1522Reputation: 1522Reputation: 1522Reputation: 1522Reputation: 1522Reputation: 1522Reputation: 1522Reputation: 1522Reputation: 1522Reputation: 1522
Correct way to include LUKS partition in fstab?


I am not looking to automount the LUKS partition, I am just wondering what the best way to include it is. The LUKS partition is on a separate internal drive.

Would it be something like

Code:
UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx  /run/media/lysander/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx  ext4  defaults,noauto  0  2
or something else?
 
Old 05-10-2019, 07:38 AM   #2
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 12,598

Rep: Reputation: 3937Reputation: 3937Reputation: 3937Reputation: 3937Reputation: 3937Reputation: 3937Reputation: 3937Reputation: 3937Reputation: 3937Reputation: 3937Reputation: 3937
https://www.golinuxcloud.com/mount-l...rtition-linux/
 
Old 05-10-2019, 08:00 AM   #3
Lysander666
Senior Member
 
Registered: Apr 2017
Location: The Underearth
Distribution: Slackware
Posts: 1,506

Original Poster
Blog Entries: 3

Rep: Reputation: 1522Reputation: 1522Reputation: 1522Reputation: 1522Reputation: 1522Reputation: 1522Reputation: 1522Reputation: 1522Reputation: 1522Reputation: 1522Reputation: 1522
Quote:
Originally Posted by pan64 View Post
Thank you, but the article says

Quote:
Now you can manually mount the encrypted partition every time node boots or you can use fstab to automatically mount the partitions during boot stage.
I don't want to do either of those, I don't want the partition to mount at all unless I choose to mount it through the Xfce file manager [I use PCManFM]. I use "noauto" in fstab for this normally.

Last edited by Lysander666; 05-10-2019 at 08:02 AM.
 
Old 05-10-2019, 12:05 PM   #4
elcore
Member
 
Registered: Sep 2014
Distribution: Slackware
Posts: 590

Rep: Reputation: Disabled
From wikipedia udev article:
Quote:
udisks (formerly known as DeviceKit-disks) is a daemon that sits on top of libudev and other kernel interfaces and provides a high-level interface to storage devices and is accessible via dbus to applications.
In this context, you probably want udisksctl (I guess). Not that I recommend it, but gui applications often use it.
NOTE: Xfce FM is Thunar. In fstab, the 'defaults' command is apparently just a placeholder in case no other command is passed.
 
Old 05-10-2019, 01:09 PM   #5
dc.901
Member
 
Registered: Aug 2018
Location: Atlanta, GA - USA
Distribution: CentOS 6-7; SuSE 8-12
Posts: 406

Rep: Reputation: 103Reputation: 103
Quote:
Originally Posted by Lysander666 View Post
I am not looking to automount the LUKS partition, I am just wondering what the best way to include it is. The LUKS partition is on a separate internal drive.

Would it be something like

Code:
UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx  /run/media/lysander/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx  ext4  defaults,noauto  0  2
or something else?
May be I am misunderstanding here, but here is what I have in fstab; this is what CentOS 7.6 install did for encrypted /home during OS install:
Code:
/dev/mapper/luks-...... /home  xfs defaults,x-systemd.device-timeout=0 0 0
 
1 members found this post helpful.
Old 05-10-2019, 01:38 PM   #6
Lysander666
Senior Member
 
Registered: Apr 2017
Location: The Underearth
Distribution: Slackware
Posts: 1,506

Original Poster
Blog Entries: 3

Rep: Reputation: 1522Reputation: 1522Reputation: 1522Reputation: 1522Reputation: 1522Reputation: 1522Reputation: 1522Reputation: 1522Reputation: 1522Reputation: 1522Reputation: 1522
Quote:
Originally Posted by dc.901 View Post
May be I am misunderstanding here, but here is what I have in fstab; this is what CentOS 7.6 install did for encrypted /home during OS install:
Code:
/dev/mapper/luks-...... /home  xfs defaults,x-systemd.device-timeout=0 0 0
I don't think you are, that looks like it might be right. However, for some reason I do need a UUID at the beginning to mount the drive. I currently have

Code:
UUID=01174ab6-cac6-4420-bc21-2eb4315194ea  /run/media/lysander/b00428ae-b437-403d-bc5c-c9a867202857  ext4  defaults,noauto  0  2
Now this is not right because I get an error on boot saying that the superblock could not be read. But I do need that UUID at the beginning to manually mount this secondary drive when I'm in Xfce. I'd also like to change the name of the partition but I can't work out how to yet.

Additionally, my /etc/crypttab is empty but I can still mount the drive and access the contents manually in Xfce. This is the guide I followed to set it up.

Last edited by Lysander666; 05-10-2019 at 01:39 PM.
 
Old 05-11-2019, 04:06 AM   #7
elcore
Member
 
Registered: Sep 2014
Distribution: Slackware
Posts: 590

Rep: Reputation: Disabled
Try with path-to-uuid or path-to-id and static mountpoint.

Code:
/dev/disk/by-uuid/<uuid> /<mountpoint> <driver> <option>  <0-1>  <0-2>
Code:
/dev/disk/by-id/ata-<id>-part1 /<mountpoint> <driver> <option>  <0-1>  <0-2>
Mountpoints in /run/media/ are dynamic mountpoints, i.e. they will change while fstab will not. And fstab must end with newline.
 
Old 05-11-2019, 09:30 AM   #8
dc.901
Member
 
Registered: Aug 2018
Location: Atlanta, GA - USA
Distribution: CentOS 6-7; SuSE 8-12
Posts: 406

Rep: Reputation: 103Reputation: 103
If you look at output of "lsblk" does the disk show "crypt" under type column?
If so, try to use that from Name column to mount; for example, this is output of my lsblk /home disk:

Code:
├─nvme0n1p3                                   259:3    0   200G  0 part  
│ └─luks-..... 253:1    0   200G  0 crypt /home
Here is entry from my crypttab:

Code:
luks-..... UUID=<Disk_UUID> none
Sorry, this may not be helpful, but I am just posting this so that you can compare and hopefully make it work for your setup?
 
Old 05-11-2019, 10:05 AM   #9
Lysander666
Senior Member
 
Registered: Apr 2017
Location: The Underearth
Distribution: Slackware
Posts: 1,506

Original Poster
Blog Entries: 3

Rep: Reputation: 1522Reputation: 1522Reputation: 1522Reputation: 1522Reputation: 1522Reputation: 1522Reputation: 1522Reputation: 1522Reputation: 1522Reputation: 1522Reputation: 1522
Thanks to both of you. elcore - it seems to me that part of the issue is that I need a static mountpoint. But this is very difficult to do with LUKS partitions since the device isn't mapped till the passphrase is entered.

dc.901 - if I enter the info into the crypttab I get a prompt on boot that I need to enter my LUKS passphrase [in addition to my user password]. I think I have to go the route of pursuing a static mountpoint name.

The output of lsblk gives the dynamic mountpoint:

Code:
`-sdb5                                          8:21   0   149G  0 part  
  `-luks-01174ab6-cac6-4420-bc21-2eb4315194ea 253:0    0   149G  0 crypt /run/media/lysander/b00428ae-b437-403d-bc5c-c9a867202857
But of course this is only after the device has been unlocked, otherwise there isn't anything.

EDIT: for now I have disabled fsck on boot for that particular partition [this is done by changing the '2' to a '0' at the end of the fstab line]. If I don't do this, I always get a message saying there's a bad superblock. So it seems my options are:

1. Automount at boot [which I don't want]
2. Manual mount at boot [which I don't really want either though it's better]
3. Find out how to make a static mount point [which is preferential if possible, with no guarantee of working].

Last edited by Lysander666; 05-11-2019 at 10:16 AM.
 
Old 05-13-2019, 06:18 AM   #10
dc.901
Member
 
Registered: Aug 2018
Location: Atlanta, GA - USA
Distribution: CentOS 6-7; SuSE 8-12
Posts: 406

Rep: Reputation: 103Reputation: 103
Quote:
Originally Posted by Lysander666 View Post
3. Find out how to make a static mount point [which is preferential if possible, with no guarantee of working].
I was playing with this earlier in rescue mode booted off CentOS media.
If I simply try to mount /dev/nvme0n1p3 (which is my /home), I get this message:
Code:
"mount: unknown filesystem type 'crypt_LUKS'"
So, here is what I had to do:

Code:
cryptsetup open /dev/nvme0n1p3 homedrive (you can call this what you want if not "homedrive")
This prompts for password.
Next:
Code:
mount /dev/mapper/homedrive /mnt/home
That mounted my /home to /mnt/home which allowed me to get the data.
 
Old 05-13-2019, 06:53 AM   #11
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 12,598

Rep: Reputation: 3937Reputation: 3937Reputation: 3937Reputation: 3937Reputation: 3937Reputation: 3937Reputation: 3937Reputation: 3937Reputation: 3937Reputation: 3937Reputation: 3937
this is what I posted. If you don't want automatic mount you need to add noauto in fstab (and user, if you want to make it mountable for users).
https://superuser.com/questions/1038...mount-flag-for
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with fstab.rootfs in on an dm-crypt/LUKS encrypted SATA drive Elthemor Linux - General 0 12-26-2013 08:44 AM
[SOLVED] Slackware 14.1 with luks crypt and initrd - what are the latest correct commands? xj25vm Slackware 24 11-20-2013 04:16 PM
UUID in /etc/fstab for luks partition malak33 Linux - Newbie 7 11-23-2012 05:20 PM
How to format master LUKS partition w/o damaging other partition kaulalla Linux - Newbie 2 05-19-2010 09:11 AM
LUKS on RAID or RAID on LUKS? retch Linux - Server 3 05-05-2010 01:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 12:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration