4

I just bought a 4tb hard drive and enclosure and attempted to encrypt it with truecrypt. I errored with a message saying the block size must be 4096 bytes for >2TB drive.

How do i alter the drive to have that block size?

Currently it says block size is 512

diskutil info /dev/disk2s2|grep "Block Size"
   Device Block Size:        512 Bytes
0

2 Answers 2

3

Note that this answer seems wrong, according to high-rep user klanomath, as I misunderstood the difference between allocation and device block size. Proceed with caution.


Format the drive using Disk Utility. Find out what disk identifier the drive has (/dev/disk0, /dev/disk1, /dev/disk2, etc…). You can do so in Disk Utility.

Then use the command line tool newfs_hfs to create a new HFS file system on the disk. The command below is taken from here.

newfs_hfs -v HFS_VOLUME_NAME -b 4k /dev/rdisk2s1

This creates a HFS volume with name "HFS_VOLUME_NAME" and a block size of 4k on the device with identifier disk2s1.

3
  • This is completely wrong. The -b switch determines the allocation block size which isn't related to the device block size (except that the allocation block size should be a 2^x multiple of the device block size and x≥3 if the real device block size is 4096 Byte (which it is on newer disks usually))
    – klanomath
    Commented Jul 7, 2017 at 17:39
  • @klanomath Thank you for pointing out my mistake. Is my answer still salvageable through editing or should I delete my answer altogether? Commented Jul 7, 2017 at 22:31
  • I have to look into it. A suitable answer is: put the hard drive in a different enclosure with a USB2SATA chip which reports a proper block size (because all newer HDDs have a device block size of 4096 Byte). The 512 Byte device block size is a so-called logical device block size.
    – klanomath
    Commented Jul 7, 2017 at 22:41
0

Sure you want to encrypt a drive that big?

Just FYI, any kind of file corruption on an encrypted volume usually means loss of the entire volume. If this drive is sitting on a shelf holding movies and pictures there's not much need.

If you are traveling with it, do you have a non-encrypted backup?

1
  • Encrypting a volume does not automatically make the entire volume unusable when a corruption occurs. The corruption is usually just limited to the file where the corruption occurs. You might be unlucky and lose a directory if the corruption happened on the directory info but you'll have to be very unlucky to lose the root directory or the entire volume. Also some file systems keep 2 copies of important data such as the directory info to protect against this.
    – Nam San
    Commented Apr 21, 2018 at 4:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .