Suppose there's a hard drive
/dev/sda, and both that:
/dev/sda1is a single ext4 partition taking up the whole disk, and it's mostly empty of data.
dumpe2fs -b /dev/sda1outputs the badblocks list, which in this case outputs single high number b representing a bad block near the end of
/dev/sda; b is fortunately not part of any file.
Now a swap partition needs to be added to the beginning of
gparted (v0.30.0-3ubuntu1) is used to:
- Resize (shrink) sda1, so that it starts several gigabytes later, but ends at the same place.
- Add a swap partition in the gap left by shrinking sda1.
gparted finishes the job and we run
dumpe2fs -b /dev/sda1 again. What happens? Does it...?
- Output nothing, meaning the resize forgot the bad block.
- Output b unchanged.
- Output b + o where o is an offset corresponding to where the just shrunk
NOTE: To simplify the question, suppose that the hard disk in question has no S.M.A.R.T. firmware. (Comments about firmware are off-topic.)