LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   Help me mount my disk (easy) (https://www.linuxquestions.org/questions/linux-security-4/help-me-mount-my-disk-easy-603834/)

lectraplayer 12-01-2007 08:34 PM

Help me mount my disk (easy)
 
I set up a encrypted partition on my SuSE 10 system during installation, and now I'm trying unsuccessfully to access it. It is the only thing listed in /etc/cryptotab and shows it having a reiserfs file system, but when I go to mount it, I have had no luck whatsoever. Even mount -t reiserfs /dev/hdx /lock and mount -t auto /dev/hdx /lock informs me that it cannot access the file system though I entered a correct password for it during bootup. How can I get it working and it be secure?

jschiwal 12-01-2007 09:46 PM

Could you post the /etc/crypto line, minus any hashed password or key info, and the directory contents of /dev/mapper/ and /proc/crypto/ and the results of "lsmod | grep dm_".

The fstab entry should look like this:
Code:

/dev/mapper/cr_cryptfile /home/jschiwal/cryptdir ext3      acl,user_xattr,noauto 0 0
There should be a line in crypttab that starts with the crypto device name. That is the device to use in /etc/fstab.

The example I posted is a loop crypto device.

It is the device part that you got wrong. However, reiser isn't supported by SuSE anymore so you might want to use a different filesystem.

If you make yourself the owner of the mounted filesystem, and add the options "noauto,user" for the options, you can mount it yourself without using sudo. Change the permissions to rwx------. Now you can even put the mount command in ~/.profile to mount it when you login.

You are encrypting a partition and not a file, but I think that the you want to look in /dev/mapper/ for the device. ( I wan't willing to repartition my drive to test that out )

lectraplayer 12-11-2007 08:07 PM

Found the problem: It seems that Novel/SuSE, in all their glory, forgot to add the "0 0: bytes to the end of the lines within the /etc/cryptotab file. That's an easy error to miss, but makes such a big difference. :D Not sure what they mean (the same thing appears in the fstab), but they're important.

jayjwa 12-13-2007 11:19 PM

Check out 'man fstab' for the full story. Here's the basic point:

Quote:

The fifth field, (fs_freq), is used for these filesystems by the
dump(8) command to determine which filesystems need to be dumped. If
the fifth field is not present, a value of zero is returned and dump
will assume that the filesystem does not need to be dumped.

The sixth field, (fs_passno), is used by the fsck(8) program to deter-
mine the order in which filesystem checks are done at reboot time. The
root filesystem should be specified with a fs_passno of 1, and other
filesystems should have a fs_passno of 2. Filesystems within a drive
will be checked sequentially, but filesystems on different drives will
be checked at the same time to utilize parallelism available in the
hardware. If the sixth field is not present or zero, a value of zero
is returned and fsck will assume that the filesystem does not need to
be checked.


All times are GMT -5. The time now is 07:18 AM.