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.
Queries:
- Why linux is asking me to run fschk? What I'm doing wrong?
- How safe is running
fsck
on 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
fsck
that 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
.tar.bz2
archive on some external, maybe FAT32, media; or remotely) – Basile Starynkevitch Sep 16 '17 at 13:27fsck
is safe and reliable (but what you did probably is not). Don't suspectfsck
but your own actions – Basile Starynkevitch Sep 16 '17 at 13:32ext2
(rather than, say,ext4
) in 2017? – Chris Davies Sep 16 '17 at 13:40I'm doing OS migration. Linux have ext4 native support so make sense to use ext4. but BSD is lacking in that department.
– Satpal Parmar Sep 16 '17 at 13:49foobar /dev/zwxy
on Linux then rebooted BSD on the same computer then rangeedo /xyz
on BSD. On Linux look also for output ofdmesg
and for recent lines in some/var/log/*.log
files – Basile Starynkevitch Sep 16 '17 at 13:49rsync
. Please go back to your question and make it quite clear what exactly you are doing (or trying to do). – Chris Davies Sep 16 '17 at 14:30sync
andumount /backup
on the BSD side, before thereboot
– Basile Starynkevitch Sep 16 '17 at 17:07