All of lore.kernel.org
 help / color / mirror / Atom feed
* [dm-crypt] LUKS is written to a device with no partition table. Is it possible to add a partition table?
@ 2016-04-19 19:08 Joe Hillenbrand
  2016-04-19 20:06 ` Arno Wagner
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Joe Hillenbrand @ 2016-04-19 19:08 UTC (permalink / raw)
  To: dm-crypt

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

I posted this to https://gitlab.com/cryptsetup/cryptsetup/issues/292
but now I'm worried that might not be the appropriate place to ask
questions.

I have a 12TB hardware RAID5 external hard drive array.

I had initially planned to only ever encrypt data to the device, but now I
need about half encrypted and half not.

The device is `/dev/sdd`. It mounts as `fatty`.

There is no partition table.

    # dd if=/dev/sdd | hexdump -C | head -1
    00000000  4c 55 4b 53 ba be 00 01  61 65 73 00 00 00 00 00
|LUKS....aes.....|

    # parted /dev/sdd
    GNU Parted 3.2
    Using /dev/sdd
    Welcome to GNU Parted! Type 'help' to view a list of commands.
    (parted) print

    Error: /dev/sdd: unrecognised disk label
    Model: ORICO H/ W RAID5 (scsi)

    Disk /dev/sdd: 12.0TB
    Sector size (logical/physical): 512B/4096B
    Partition Table: unknown
    Disk Flags:

As you can see LUKS starts at the first byte of the device.

There is a btrfs filesystem on the LUKS device and I resized it down to 4TB.

    # cryptsetup status fatty
    /dev/mapper/fatty is active.
      type:    LUKS1
      cipher:  aes-xts-plain64
      keysize: 256 bits
      device:  /dev/sdd
      offset:  4096 sectors
      size:    23441764352 sectors
      mode:    read/write

    # btrfs filesystem show /dev/mapper/fatty
    Label: 'fatty'  uuid: XXX-XX-XX-XX-XXXXXXXXX
        Total devices 1 FS bytes used 2.75TiB
        devid    1 size 4.00TiB used 2.80TiB path /dev/mapper/fatty

I can't really move the data anywhere, because it's too big and would
require buying more hardware.
Is it possible to add a partition table without losing the data?

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

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

end of thread, other threads:[~2016-04-21  9:02 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-19 19:08 [dm-crypt] LUKS is written to a device with no partition table. Is it possible to add a partition table? Joe Hillenbrand
2016-04-19 20:06 ` Arno Wagner
2016-04-19 20:20   ` Ralf Ramsauer
2016-04-19 21:15     ` Michael Kjörling
2016-04-19 20:14 ` Ralf Ramsauer
2016-04-19 21:02 ` Joe Hillenbrand
2016-04-20  2:28   ` f-dm-c
2016-04-20 19:26   ` Joe Hillenbrand
2016-04-20 19:43     ` Joe Hillenbrand
2016-04-20 19:54       ` Joe Hillenbrand
2016-04-21  2:54         ` David Christensen
2016-04-21  9:02         ` Arno Wagner
2016-04-20  4:14 ` David Christensen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.