Hi all, and congratulation for this great project!
I'm using dm-cache released into 3.9.6 kernel on a Centos 6.3 Linux distro.
I've attached a QNAP 12TB iScsi NAS with 2 LUN's:
scsi6 : iSCSI Initiator over TCP/IP
scsi 6:0:0:0: Direct-Access QNAP iSCSI Storage 3.1 PQ: 0 ANSI: 5
sd 6:0:0:0: Attached scsi generic sg1 type 0
sd 6:0:0:0: [sdb] 10588520448 512-byte logical blocks: (5.42 TB/4.93 TiB)
scsi 6:0:0:1: Direct-Access QNAP iSCSI Storage 3.1 PQ: 0 ANSI: 5
sd 6:0:0:1: Attached scsi generic sg2 type 0
sd 6:0:0:1: [sdc] 10622074880 512-byte logical blocks: (5.43 TB/4.94 TiB)
sd 6:0:0:0: [sdb] Write Protect is off
sd 6:0:0:0: [sdb] Mode Sense: 2f 00 00 00
sd 6:0:0:0: [sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
sd 6:0:0:1: [sdc] Write Protect is off
sd 6:0:0:1: [sdc] Mode Sense: 2f 00 00 00
sd 6:0:0:1: [sdc] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
sdb: sdb1
sdc: sdc1
sd 6:0:0:0: [sdb] Attached SCSI disk
sd 6:0:0:1: [sdc] Attached SCSI disk
Using parted I've created a GPT partition:
[root@localhost ~]# parted /dev/sdb print
Modello: QNAP iSCSI Storage (scsi)
Disco /dev/sdb: 5421GB
Dimensione del settore (logica/fisica): 512B/512B
Tabella delle partizioni: gpt
Numero Inizio Fine Dimensione File system Nome Flag
1 1049kB 5421GB 5421GB reiserfs primary
[root@localhost ~]# fdisk /dev/sdb
WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.
WARNING: The size of this disk is 5.4 TB (5421322469376 bytes).
DOS partition table format can not be used on drives for volumes
larger than (2199023255040 bytes) for 512-byte sectors. Use parted(1) and GUID
partition table format (GPT).
WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
switch off the mode (command 'c') and change display units to
sectors (command 'u').
Comando (m per richiamare la guida): p
Disco /dev/sdb: 5421.3 GB, 5421322469376 byte
255 testine, 63 settori/tracce, 659104 cilindri
Unità = cilindri di 16065 * 512 = 8225280 byte
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 262144 bytes
Identificativo disco: 0x00000000
Dispositivo Boot Start End Blocks Id System
/dev/sdb1 1 267350
2147483647+ ee GPT
Comando (m per richiamare la guida): q
[root@localhost ~]# blockdev --getsz /dev/sdb
10588520448
Now i'm using local sata disk for metadata and cache storage
[root@localhost ~]# fdisk /dev/sda -l
Disco /dev/sda: 500.1 GB, 500107862016 byte
255 testine, 63 settori/tracce, 60801 cilindri
Unità = cilindri di 16065 * 512 = 8225280 byte
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Identificativo disco: 0x0008fdda
Dispositivo Boot Start End Blocks Id System
/dev/sda1 * 1 13 102400 83 Linux
La partizione 1 non termina al limite del cilindro.
/dev/sda2 13 141 1024000 83 Linux
La partizione 2 non termina al limite del cilindro.
/dev/sda3 141 396 2048000 83 Linux
La partizione 3 non termina al limite del cilindro.
/dev/sda4 396 60802 485211136 5 Esteso
/dev/sda5 396 651 2048000 83 Linux
/dev/sda6 651 779 1024000 82 Linux swap / Solaris
/dev/sda7 779 906 1024000 83 Linux
/dev/sda8 906 40000 314025472+ 83 Linux
/dev/sda9 40001 41000 8032468+ 83 Linux
/dev/sda10 41001 60802 159054028+ 83 Linux
And formatted all reiserfs partitions sda9 (8GByte) for metadata, sda10 (160Gbytes) for cache and sdb1 5Tbyte for origin data disk.
Using the command:
[root@localhost ~]# dmsetup create dati1 --table '0 10588520448 cache /dev/sda9 /dev/sda10 /dev/sdb1 2048 1 writethrough default 0'
device-mapper: reload ioctl on dati1 failed: Invalid argument
Command failed with dmesg message:
Jun 19 09:18:57 localhost kernel: device-mapper: table: 253:0: cache: Device size larger than cached device
Jun 19 09:18:57 localhost kernel: device-mapper: ioctl: error adding target to table
Where i'm wrong?
Thanks for all your work.
Greetings
Vito