I have x86 based box running FreeBSD 10.1. I have made it dual boot with Red hat Linux as other OS. Now I'm migrating a UFS partition 'A' on a FreeBSD (10.1) to ext2 based partition on Linux. I'm using partition 'B' as temporary storage.
I am following below procedure.
- In FreeBSD: I format 'B' as ext2 and move data from 'A' to 'B' using rsync. Reboot the box.
- Box comes up with Linux. I now format 'A' as ext2 in Linux , mount B as ext2 and move data from 'B' to 'A' using rsync
Issue: Many times mount of 'B' in Linux fails and suggest to run fsck. When I run
fsck in non-interactive mode it fails and suggest to run in manually. I cannot 'fsck' run manually as box are remotely located. Secondly I'm worried if
fsck may lead to data loss.
- Why linux is asking me to run fschk? What I'm doing wrong?
- How safe is running
fsckon a partition? My box will not able to come up cleanly in case files are removed in the operation.
- Is there any way to log all operation done under
fsckthat I can use for debugging
Operation done on FreeBSD:
#format raw partition as ext2 mkfs.ext2 /dev/mfid0s1f #mount newly formated partition as backup mkdir -p /backup mount /dev/mfid0s1f /backup #move data for UFS partition mounted as 'data' to ext2 partition rsync -a /data/* /backup #reboot the box reboot
Operation done in Linux (via rc.local):
case 1: I try to mount 'backup' without fsck mkdir -p /backup mount /dev/sda8 /backup mount fail with suggestion to run fsck. case 2: I add non-interective fsck mkdir -p /backup e2fsck -p /dev/sda8 fail with : /dev/sda8: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY