DM-Crypt Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [dm-crypt] Partition mandatory?
@ 2011-06-19 13:54 Patrick
  2011-06-19 14:53 ` Milan Broz
  0 siblings, 1 reply; 5+ messages in thread
From: Patrick @ 2011-06-19 13:54 UTC (permalink / raw)
  To: dm-crypt

[-- Attachment #1: Type: text/plain, Size: 1892 bytes --]

Hello,

I am quite new to linux (Ubuntu) and wish to use encrypted drives. I
already use LUKS encrypted disks, that's great.
I have a question regarding full disk encryption.

I tried to find an answer in the doc... "rtfm" did not solve it, neither
did some asking on IRC channels (answers like "no that's bad!", with no
further explanation as why "no" weren't just convincing enough... ;-)   ).

The case :
I want to encrypt a full USB disk and my question is : is it mandatory
to have a partition existing on the device and to luskformat the
partition? In other words, is it OK to luksformat the full device,
without mentionning any partition? Is it off "standards"?

In fact, I tried to encrypt a full disk using something like :
/sudo cryptsetup luksFormat -c aes-xts-plain -h whirlpool -s 512 /dev/sdx/
x being the device, without mentioning a partition.

That apparently works perfectly well, the full device is then encrypted
and can be formatted as ext4 or whatever I want it to be formatted to. I
can mount it and use it.
No partition is seen on the device when inserted without decrypting, good.

I would like to know if this could cause some side effects, as I don't
encrypt a partition but directly the device itself.

Being cautious, I did create a partition for now... and did encrypt this
one. The partition using the full disk...
/sudo cryptsetup luksFormat -c aes-xts-plain -h whirlpool -s 512
/dev/sde1 (for example)/*
*
For my own knowledge I would really appreciate to know if it would be OK
to luksformat a full device, without using partitions. And most of all I
would like to know why (whatever yes or no the answer could be! )

Maybe is this question related to the linux "philosophy" and devices
architecture that still isn't fully natural for me for now as I am an
ex-Windows user, but I'm learning and happy to do so! :-)

Hope you can help!
Best regards,

Patrick

[-- Attachment #2: Type: text/html, Size: 2722 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dm-crypt] Partition mandatory?
  2011-06-19 13:54 [dm-crypt] Partition mandatory? Patrick
@ 2011-06-19 14:53 ` Milan Broz
  2011-06-19 15:25   ` Patrick
  0 siblings, 1 reply; 5+ messages in thread
From: Milan Broz @ 2011-06-19 14:53 UTC (permalink / raw)
  To: Patrick; +Cc: dm-crypt

On 06/19/2011 03:54 PM, Patrick wrote:
> The case : I want to encrypt a full USB disk and my question is : is
> it mandatory to have a partition existing on the device and to
> luskformat the partition? In other words, is it OK to luksformat the
> full device, without mentionning any partition? Is it off
> "standards"?

You can use whole device without partition table, there is no problem
in Linux. For LUKS it is just block device - it is not important
if it is partition or the whole device.

There is only one situation, I know about, when using partition is safer.

If you have portable disk (or USB flashdrive or whatever) and there
is no partition table on it, and you plug such drive to
another system (namely older version of Windows) it
likes to offer you to "initialize" drive - which can destruct
LUKS header there. If there is a partition table, it thinks that
drive was already initialized preventing it.
(I think it is not problem in recent versions but not sure.)

Milan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dm-crypt] Partition mandatory?
  2011-06-19 14:53 ` Milan Broz
@ 2011-06-19 15:25   ` Patrick
  2011-06-19 15:46     ` Milan Broz
  0 siblings, 1 reply; 5+ messages in thread
From: Patrick @ 2011-06-19 15:25 UTC (permalink / raw)
  To: Milan Broz; +Cc: dm-crypt

[-- Attachment #1: Type: text/plain, Size: 1464 bytes --]

Thank you for your quick and clear answer Milan! Tha'ts really great! :D

So, in the case of such a header destruction by an "old" OS, I think it
is still possible to restore the header I saved using

_luksHeaderBackup_ <device> --header-backup-file <file>

doing

_luksHeaderRestore_ <device> --header-backup-file <file>

Correct?

Best regards,

Patrick



Le 19. 06. 11 16:53, Milan Broz a écrit :
> On 06/19/2011 03:54 PM, Patrick wrote:
>> The case : I want to encrypt a full USB disk and my question is : is
>> it mandatory to have a partition existing on the device and to
>> luskformat the partition? In other words, is it OK to luksformat the
>> full device, without mentionning any partition? Is it off
>> "standards"?
> You can use whole device without partition table, there is no problem
> in Linux. For LUKS it is just block device - it is not important
> if it is partition or the whole device.
>
> There is only one situation, I know about, when using partition is safer.
>
> If you have portable disk (or USB flashdrive or whatever) and there
> is no partition table on it, and you plug such drive to
> another system (namely older version of Windows) it
> likes to offer you to "initialize" drive - which can destruct
> LUKS header there. If there is a partition table, it thinks that
> drive was already initialized preventing it.
> (I think it is not problem in recent versions but not sure.)
>
> Milan

[-- Attachment #2: Type: text/html, Size: 2011 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dm-crypt] Partition mandatory?
  2011-06-19 15:25   ` Patrick
@ 2011-06-19 15:46     ` Milan Broz
  2011-06-19 17:47       ` Patrick
  0 siblings, 1 reply; 5+ messages in thread
From: Milan Broz @ 2011-06-19 15:46 UTC (permalink / raw)
  To: Patrick; +Cc: dm-crypt


On 06/19/2011 05:25 PM, Patrick wrote:
> So, in the case of such a header destruction by an "old" OS, I think
> it is still possible to restore the header I saved using
> 
> _luksHeaderBackup_ <device> --header-backup-file <file>
> 
> doing
> 
> _luksHeaderRestore_ <device> --header-backup-file <file>
> 
> Correct?

yes, but it s just backup of LUKS header. Not a backup of data inside:-)
(with old header backup and passphrase you can unlock the drive,
so store it on safe place)

Milan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dm-crypt] Partition mandatory?
  2011-06-19 15:46     ` Milan Broz
@ 2011-06-19 17:47       ` Patrick
  0 siblings, 0 replies; 5+ messages in thread
From: Patrick @ 2011-06-19 17:47 UTC (permalink / raw)
  To: Milan Broz; +Cc: dm-crypt

Yes, sure I'll do!
Thanks again for your answers!

Best regards,

Patrick


Le 19. 06. 11 17:46, Milan Broz a écrit :
> On 06/19/2011 05:25 PM, Patrick wrote:
>> So, in the case of such a header destruction by an "old" OS, I think
>> it is still possible to restore the header I saved using
>>
>> _luksHeaderBackup_ <device> --header-backup-file <file>
>>
>> doing
>>
>> _luksHeaderRestore_ <device> --header-backup-file <file>
>>
>> Correct?
> yes, but it s just backup of LUKS header. Not a backup of data inside:-)
> (with old header backup and passphrase you can unlock the drive,
> so store it on safe place)
>
> Milan
>
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-06-19 17:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-19 13:54 [dm-crypt] Partition mandatory? Patrick
2011-06-19 14:53 ` Milan Broz
2011-06-19 15:25   ` Patrick
2011-06-19 15:46     ` Milan Broz
2011-06-19 17:47       ` Patrick

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox