We recently decided to change the os from Debian 8.7.1 to Debian 9.x. (Note:This is not a traditional upgrade process) To accomplish this in our product we basically swap out the entire os using partitions and grub boot swapping.
This was all working when going from Debian 8 -> Debian 8. However, when we attempted this using Debian 9, the result is an empty file system on the target partition.
While running from another partition, we extract the Debian 9 based image using
dd if=/dev/sda2 bs=1M | gzip --best - > /mnt/image/image.gz
We then take image.gz and that is our new full os image.
The Debian 8 system obtains the image.gz file and runs the following
gunzip -c /tmp/image.gz | dd of=/dev/sda3 bs=1M
Everything goes as normal however when we change grub to boot to that partition, there are no files present. Sure enough, switch to a known good partition and mount that partition and the file system is empty.
I have tried both dd and partclone.ext4 to try and see if it changes anything but it results in the same outcome.
The only thing we have found so far is that on Debian 9, the journaling is 64bit and on Debian 8 there is no mention of that when you run the following
file -sL /dev/sda3
Edit: Output from kern.log
Oct 22 22:05:34 machine kernel: [280285.531140] EXT4-fs (sda3): error count since last fsck: 3
Oct 22 22:05:34 machine kernel: [280285.531159] EXT4-fs (sda3): initial error at time 1508450313: htree_dirblock_to_tree: 914: inode 2: block 8774
Oct 22 22:05:34 machine kernel: [280285.531177] EXT4-fs (sda3): last error at time 1508450339: htree_dirblock_to_tree:914 : inode 2: block 8774
Oct 23 14:05:01 machine kernel: [337855.006072] EXT4-fs error (device sda3): htree_dirblock_to_tree:914: inode #2: block 8774: comm ls: bad entry in directory: rec_len is smaller than minimal - offset=0(0), inode=0, rec_len=0, name_len=0
Is it not possible to mount a ext4 partition created on Debian 9 on a Debian 8 system?