Skip to content

Prepareing WD My Book Duo for Linux Usage

WD My Book Duo comes as a RAID 0 formatted with NTFS. For the Homeserver, it is prepared as a RAID 1 with ext4.

To change the RAID configuration, the drive needs to be connected to a machine which allows installation of WD Drive Utilities (see https://support-en.wd.com/app/products/product-detail/p/123#WD_downloads) – this could be Windows or Mac. After starting the Tool, the RAID mode can be changed in tab RAID to RAID 1. With clicking on “Configure” the changes are performed. Once the process is completed, you can unmount the drive and disconnect it from the machine.

Next the drive can be connected to the linux machine for partitioning and formatting.

Identify the drive, in this case it is available under /dev/sda:

> sudo fdisk -l

[...]
Disk /dev/sda: 7.28 TiB, 8001531412480 bytes, 15627991040 sectors
Disk model: My Book Duo 25F6
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: xxxxxxxxxxxx

Device      Start         End     Sectors  Size Type
/dev/sda1      40      409639      409600  200M EFI System
/dev/sda2  409640 15627728855 15627319216  7.3T Apple HFS/HFS+

Next fdisk is used to start partitioning the drive. Use the interactive menu to delete existing partitions with “d”, then create one new partition with “n” and finally write the changes with “w”.

> sudo fdisk /dev/sda

Welcome to fdisk (util-linux 2.36.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Command (m for help): m

Help:

  GPT
   M   enter protective/hybrid MBR

  Generic
   d   delete a partition
   F   list free unpartitioned space
   l   list known partition types
   n   add a new partition
   p   print the partition table
   t   change a partition type
   v   verify the partition table
   i   print information about a partition

  Misc
   m   print this menu
   x   extra functionality (experts only)

  Script
   I   load disk layout from sfdisk script file
   O   dump disk layout to sfdisk script file

  Save & Exit
   w   write table to disk and exit
   q   quit without saving changes

  Create a new label
   g   create a new empty GPT partition table
   G   create a new empty SGI (IRIX) partition table
   o   create a new empty DOS partition table
   s   create a new empty Sun partition table

Command (m for help): d
Partition number (1,2, default 2): 1

Partition 1 has been deleted.

Command (m for help): d
Selected partition 2
Partition 2 has been deleted.

Command (m for help): F
Unpartitioned space /dev/sda: 7.28 TiB, 8001530347008 bytes, 15627988959 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes

Start         End     Sectors  Size
 2048 15627991006 15627988959  7.3T

Command (m for help): n
Partition number (1-128, default 1): 
First sector (34-15627991006, default 2048): 
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-15627991006, default 15627991006): 

Created a new partition 1 of type 'Linux filesystem' and of size 7.3 TiB.

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

Finally, the new partition needs to be formatted with a filesystem, ext4 in this case:

> sudo mkfs -t ext4 /dev/sda1
mke2fs 1.46.2 (28-Feb-2021)
Creating filesystem with 1953498619 4k blocks and 244191232 inodes
Filesystem UUID: 9b187c5b-2e94-4cdb-9814-3301366caa68
Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
	4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 
	102400000, 214990848, 512000000, 550731776, 644972544, 1934917632

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (262144 blocks): done
Writing superblocks and filesystem accounting information: done

The drive is now ready to be used. It can be permanently mounted with the following steps:

# Create a mount point:
> sudo mkdir /media/sda1

# Mount the drive into the mount point:
> sudo mount /dev/sda1 /media/sda1 

# Identify the UUID of the drive:
> sudo blkid
[...]
/dev/sda1: UUID="9b187c5b-2e94-4cdb-9814-3301366caa68" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="7f369acd-b624-a348-b440-d5d2463415f4"

# Open the fstab file:
> sudo nano /etc/fstab

# Append the following line:
UUID=9b187c5b-2e94-4cdb-9814-3301366caa68       /media/sda1     ext4    defaults        0       0

Leave a Reply

Your email address will not be published. Required fields are marked *