LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 06-14-2020, 11:39 AM   #61
qelpp
Member
 
Registered: Jun 2020
Posts: 35

Original Poster
Rep: Reputation: Disabled

Code:
root@neon:~# cryptsetup luksOpen /dev/sda3 sda3_crypt
Enter passphrase for /dev/sda3: 
root@neon:~# stat /dev/dm-1
  File: /dev/dm-1
  Size: 0               Blocks: 0          IO Block: 4096   block special file
Device: 6h/6d   Inode: 677         Links: 1     Device type: fd,1
Access: (0660/brw-rw----)  Uid: (    0/    root)   Gid: (    6/    disk)
Access: 2020-06-14 16:38:02.417892970 +0000
Modify: 2020-06-14 16:38:02.417892970 +0000
Change: 2020-06-14 16:38:02.417892970 +0000
 Birth: -
root@neon:~#
 
Old 06-14-2020, 02:31 PM   #62
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,780

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
OK, it's a block special file just as it should be, or at least it is now. I have no idea why the file command would have reported it as a directory.

Last edited by rknichols; 06-14-2020 at 02:32 PM.
 
Old 06-14-2020, 04:28 PM   #63
qelpp
Member
 
Registered: Jun 2020
Posts: 35

Original Poster
Rep: Reputation: Disabled
Code:
root@neon:~# sudo file -sL /dev/mapper/Live--OS--vg-root /dev/mapper/Live--OS--vg-swap_1
/dev/mapper/Live--OS--vg-root:   data
/dev/mapper/Live--OS--vg-swap_1: data
root@neon:~#
It still shows that.

Last edited by qelpp; 06-14-2020 at 04:31 PM. Reason: ttypo
 
Old 06-14-2020, 04:33 PM   #64
qelpp
Member
 
Registered: Jun 2020
Posts: 35

Original Poster
Rep: Reputation: Disabled
stat /dev/dm-0 shows this:

Code:
root@neon:~# stat /dev/dm-0
  File: /dev/dm-0
  Size: 0               Blocks: 0          IO Block: 4096   block special file
Device: 6h/6d   Inode: 671         Links: 1     Device type: fd,0
Access: (0660/brw-rw----)  Uid: (    0/    root)   Gid: (    6/    disk)
Access: 2020-06-14 16:38:02.301720398 +0000
Modify: 2020-06-14 16:38:02.301720398 +0000
Change: 2020-06-14 16:38:02.301720398 +0000
 Birth: -
root@neon:~#

And namei /dev/mapper/sda3_crypt shows this

Code:
root@neon:~# namei /dev/mapper/sda3_crypt
f: /dev/mapper/sda3_crypt
 d /
 d dev
 d mapper
 l sda3_crypt -> ../dm-0
   d ..
   b dm-0
root@neon:~

Last edited by qelpp; 06-14-2020 at 06:11 PM.
 
Old 06-14-2020, 07:10 PM   #65
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,780

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
Quote:
Originally Posted by qelpp View Post
Code:
root@neon:~# sudo file -sL /dev/mapper/Live--OS--vg-root /dev/mapper/Live--OS--vg-swap_1
/dev/mapper/Live--OS--vg-root:   data
/dev/mapper/Live--OS--vg-swap_1: data
root@neon:~#
It still shows that.
No, now it's showing "data", which is what I would expect from an device that has never been formatted with a filesystem. Before, it was showing "directory", which is impossible for a device. Looking back (#46. #47), I now see you had run some very inappropriate mkdir commands, which put directories in /dev/mapper where a successful luksOpen would have created symlinks to dm-* devices. Sorry, I didn't notice that before.
 
Old 06-14-2020, 07:34 PM   #66
qelpp
Member
 
Registered: Jun 2020
Posts: 35

Original Poster
Rep: Reputation: Disabled
I rebooted prior to #63; and after #64 had to log out. If that makes any difference in today's results.
 
Old 06-14-2020, 07:54 PM   #67
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Quote:
Originally Posted by qelpp View Post
I rebooted prior to #63; and after #64 had to log out. If that makes any difference in today's results.
Whatever files and directories you create in the /dev filesystem will disappear when you reboot. /dev is recreated at each system startup, based on the hardware that the kernel discovers. This is why you get different results at different times.

Earlier, you created directories here and there and everywhere under /dev, which led to the result in https://www.linuxquestions.org/quest...ml#post6133591. All that is gone now.

You seem to be thorougly confused by mountpoints, logical volumes, devices files and symbolic links. I would grab an intermediate Linux course, book or tutorial and learn about these things; this is fundamental knowledge required for managing a Linux system.

This is what happened.

When you open your LUKS device with cryptsetup open /dev/sda3 sda3_crypt --type luks, a new device mapper device is created, named /dev/dm-# (where # is an autoincrementing number). This device represents the decrypted data. Whatever you write to it will be encrypted and stored on /dev/sda3, and whatever you read from it will be read from /dev/sda3, then decrypted.

In addition, the cryptsetup open command results in the creation of a symbolic link /dev/mapper/sda3_crypt, which is a different name for the same /dev/dm-# device.

Now, the data on /dev/mapper/sda3_crypt or /dev/dm-# can't be used immediately. In your case, an LVM physical volume has been created on top of that device. On that physical volume, you find several logical volumes (which you can loosely consider to be "flexible partitions").

One of the logical volumes is named Live-OS-...root. The installer was able to create the encrypted device, the physical volume and the two logical volumes, but at this point you noticed your mistake and hit the back button, which prevented the installer from creating a filesystem on top of that logical volume. This is why you can't mount it.

Your disk contains a hierarchy of data:

sda contains partitions sda1, sda2, sda3
sda3 contains a LUKS device
The LUKS device contains a physical volume
The physical volume contains two logical volumes named root and swap
The root logical volume is meant to contain the root filesystem (but doesn't because the installation was aborted)

Last edited by berndbausch; 06-14-2020 at 09:19 PM. Reason: Several tons of additional info
 
Old 06-15-2020, 05:22 PM   #68
qelpp
Member
 
Registered: Jun 2020
Posts: 35

Original Poster
Rep: Reputation: Disabled
Thank you
 
  


Reply



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
[SOLVED] Cannot Update KDE Neon or Reinstall KDE Neon or Linux Mint goatchaser Linux - Newbie 3 12-29-2017 01:04 PM
LXer: KDE Neon Linux Developer Edition to Use Wayland by Default for KDE Plasma 5.8 LXer Syndicated Linux News 0 09-07-2016 05:03 AM
LXer: KDE Plasma Wayland Image Now Built on KDE Neon Infrastructure, Qt 5.7 Is Coming LXer Syndicated Linux News 0 07-05-2016 12:36 AM
LXer: conf.kde.in: Project Neon Returns With Bleeding Edge KDE Software LXer Syndicated Linux News 0 03-11-2011 05:41 PM
neon-0.26.4 vs neon-0.27.3 rob.til Slackware 0 08-30-2008 07:09 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 06:20 PM.

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
Open Source Consulting | Domain Registration