1

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?

  • Try to mount the ext4 partition created on Debian 9 under Debian 8 by hand, and share the error message and the dmesg output or kernel log if the mount command fails. – Ferenc Wágner Oct 21 '17 at 7:26
  • Added logging from kern.log – spowser Oct 23 '17 at 14:12
  • 1
    I was able to point Debian 8 to the Debian 9 sources.list to update the e2fsprogs package. This updates e2fsck and allows it to check the new partition. It finds and fixes issue with the drive which I suspect is caused by the new 64bit journal. At this point, I think the answer is, don't try and mount a Debian 9 partition on Debian 8 – spowser Oct 23 '17 at 18:57
  • I have upgraded allmost all my servers to Debian 9 and bot a single problem mounting partitions – Rui F Ribeiro Oct 24 '17 at 6:39
  • If a filesystem uses incompatible (or critical, as opposed to optional) features the kernel doesn't know of, it should cleanly refuse to mount it. If any corruption stems from the attempt, that's a bug. – Ferenc Wágner Oct 24 '17 at 7:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.