*New 11.3 series Release:
2019-10-19: XigmaNAS 11.3.0.4.7014 - released

*New 12.0 series Release:
2019-10-05: XigmaNAS 12.0.0.4.6928 - released!

*New 11.2 series Release:
2019-09-23: XigmaNAS 11.2.0.4.6881 - released!

We really need "Your" help on XigmaNAS https://translations.launchpad.net/xigmanas translations. Please help today!

Producing and hosting XigmaNAS costs money. Please consider donating for our project so that we can continue to offer you the best.
We need your support! eg: PAYPAL

Corrupt UFS Filesystem - [SOLVED]

Filesystems(UFS, EXT2, FAT, NTFS, ZFS), mount points, partitions
Forum rules
Set-Up GuideFAQsForum Rules
Post Reply
ldkraemer
Starter
Starter
Posts: 53
Joined: 26 Jun 2012 22:35
Status: Offline

Corrupt UFS Filesystem - [SOLVED]

#1

Post by ldkraemer » 11 Jul 2012 13:51

I have a Freenas system (FreeNAS-i386-LiveCD-0.7.2.5252.img) Embedded. I was updating my Gateway Laptop and I copied most of my folders
from /home/larry to my FreeNAS Server via NFS. My copies were then on my FreeNAS server.

After replacing an on Version of Ubuntu with Linux Mint 201204, I tried copying my folders & files back to my fresh install. I found I didn't have
permissions to allow this. I set up Linum Mint with the same user and passwords. But, Linux Mint would only access my FreeNAS Server with CIFS/SMB.

I used my Debian Squeeze Laptop to change Permissions and owner:group of my Gateway folder via NFS. Somehow in the process my UFS got corrupted and
is now cycling, so that it runs a bit, and then reboots. It is about a 4 to 5 minute cycle. My FreeNAS Console shows an error message as a read error and
corrupted blocks.

My question is how to I get fsck to run on my Drive to try and repair the UFS file system from Linux? I downloaded some BSD LiveCD systems, but don't
know the commands to show the Sata Drive, or how to get fsck to run properly. In Linux I could execute mount, sudo blkid, sudo fdisk -l to locate the drive.
What commands would be specific to BSD? But Linux (Debian) won't check the UFS system. Would the proper BSD fsck command be: fsck -F UFS /dev/adx1
where x was found from a previous BSD command? Would there be a better way to recover my files, or fix my UFS, so I can finish my Linux Mint file rebuild?

Internet searches with Google last night didn't find much on repairing/fixing UFS.

Thanks for any help with the BSD commands.

Larry

ldkraemer
Starter
Starter
Posts: 53
Joined: 26 Jun 2012 22:35
Status: Offline

Re: Corrupt UFS Filesystem - FreeNAS Hard Drive

#2

Post by ldkraemer » 11 Jul 2012 14:25

Folks,
I finally found the answer at: http://wiki.nas4free.org/doku.php?id=faq:0001

Here is my output from running fsck:

First Execution:
Note: The disk is currently mounted! The mount point will be removed temporarily to perform selected command.

** /dev/ad2p1
** Last Mounted on /mnt/mysata
** Phase 1 - Check Blocks and Sizes

CANNOT READ BLK: 815350016
UNEXPECTED SOFT UPDATE INCONSISTENCY

CONTINUE? yes

THE FOLLOWING DISK SECTORS COULD NOT BE READ: 815350019,
** Phase 2 - Check Pathnames
** Phase 3 - Check Connectivity
** Phase 4 - Check Reference Counts
** Phase 5 - Check Cyl groups
FREE BLK COUNT(S) WRONG IN SUPERBLK
SALVAGE? yes

SUMMARY INFORMATION BAD
SALVAGE? yes

BLK(S) MISSING IN BIT MAPS
SALVAGE? yes


CANNOT READ BLK: 815350016
UNEXPECTED SOFT UPDATE INCONSISTENCY

CONTINUE? yes

THE FOLLOWING DISK SECTORS COULD NOT BE READ: 815350019,
WRITING PARTIALLY ZERO'ED BLOCK 815350016 TO DISK

UNEXPECTED SOFT UPDATE INCONSISTENCY
54154 files, 35668329 used, 84508756 free (4972 frags, 10562973 blocks, 0.0% fragmentation)

***** FILE SYSTEM STILL DIRTY *****

***** FILE SYSTEM WAS MODIFIED *****

***** PLEASE RERUN FSCK *****
Successful



Second Execution:
Note: The disk is currently mounted! The mount point will be removed temporarily to perform selected command.

** /dev/ad2p1
** Last Mounted on /mnt/mysata
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3 - Check Connectivity
** Phase 4 - Check Reference Counts
** Phase 5 - Check Cyl groups
54154 files, 35668329 used, 84508756 free (4972 frags, 10562973 blocks, 0.0% fragmentation)

***** FILE SYSTEM MARKED CLEAN *****
Successful


Third Execution:
Note: The disk is currently mounted! The mount point will be removed temporarily to perform selected command.

** /dev/ad2p1
** Last Mounted on /mnt/mysata
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3 - Check Connectivity
** Phase 4 - Check Reference Counts
** Phase 5 - Check Cyl groups
54154 files, 35668329 used, 84508756 free (4972 frags, 10562973 blocks, 0.0% fragmentation)
Successful

WHEW! Now it boots and runs, so I can get back to copying my files to restore my updated Laptop.

THANKS for fsck.............& FreeNAS & NAS4Free!

Larry

User avatar
erico.bettoni
experienced User
experienced User
Posts: 148
Joined: 25 Jun 2012 22:36
Location: São Paulo - Brasil
Status: Offline

Re: Corrupt UFS Filesystem - FreeNAS Hard Drive

#3

Post by erico.bettoni » 12 Jul 2012 01:57

Thanks for taking the time to post this! I can imagine the despair...

ericp3371
NewUser
NewUser
Posts: 1
Joined: 11 Dec 2014 21:46
Status: Offline

Re: Corrupt UFS Filesystem - FreeNAS Hard Drive

#4

Post by ericp3371 » 11 Dec 2014 22:09

Hello All,

I've been struggling with a corrupt volume for several days, trying to fsck it, but I kept getting a "NO WRITE" status. I spent days scouring the web for solutions, and as usual, refused to seek help and was determined to find the solution on my own. Well, I finally figured it out, so I thought I'd post it here in case someone else has the same problem.

My problem was a degraded volume, causing constant reboot of my FreeNAS. The problem was due to a corrupted file system. After much research, I finally came across this article, and tried the solution. I therefore...

1) I logged into the FreeNAS webgui, deleted the two CIFS shares and deleted the volume
2) I then went to my server console and ran the "mount" command to ensure the volume was umount 'ed, which it was.
3) I further confirmed that the volume's mount point (directory) was no longer present in /mnt, which it wasn't.
4) By researching my dmesg and other logs, I confirmed that the suspect drive was ada1.
5) I checked /dev to see if there were any partitions for ada1 (ada1s1, ada1p1, etc.), but all that was listed was ada1.
6) I proceeded to reboot the server
7) I re-checked to make sure the volume was not mounted
8) I ran the command: fsck -t ufs -y /dev/ada1
9) fsck ran correctly, but it would refuse to make the repairs because it kept coming up as "NO WRITE" status. I let it run regardless, where I saw a multitude of LINE COUNT and SUPERBLK errors

No matter what I tried, I could not get it to run in write mode! After doing a bit more research, I finally figured out the problem. See, this volume is actually a RAID1 (mirrored) volume, consisting of two Seagate 2TB SATA drives, ada1 and ada2. As soon as the errors came up, some of the error messages, which caused the "kernel panic" and subsequent reboots, led me to believe that the problem lied with the ada2 drive failing. So I immediately unplugged it to prevent further damage, as the files on this mirrored array are crucial to my business, and contain the archived client records for over fifteen years! I then wanted to backup all data off the good drive, just in case, and then rebuild the array afterwards. The backup was in case rebuilding the array would lead to data loss. However every time I tried to copy off the "good drive" (ada1), my server would reboot.

Anyway, as my "wheel kept turning" in my head, I finally realized that I was running the fsck FOR THE WRONG DEVICE! Because ada1 was actually part of a mirrored array, the device I needed to run it on was located in: /dev/mirror/ !!! My mirrored volume was named "ARRAY01", and sure enough, I came across /dev/mirror/ARRAY01 .

I therefore tried to run fsck again with the -y option, only running it on /dev/mirror/ARRAY01, and sure enough it worked! It ran in write mode, and repaired all errors. I will now proceed to backup all 1.5TB of data, onto my ext2 formatted usb backup drive, and I will then repeat the repair on ada2 and then I'll try to rebuild the array. If the array won't rebuild, due to having repaired both drives separately, that's fine. I can just create a new array and reload the backup.

So to conclude, if you have a RAID1 FreeNAS array which has corrupted, and you want to repair the file system, you need to run fsck -t ufs -y /dev/mirror/**** (**** being the name of your mirrored volume).

I hope this helps someone in the future who has a corrupted mirrored volume, therefore saving them from days of research like I had to do. I'm surprised that there is not one single article on the entire web regarding this problem! (Running fsck -y on a corrupted mirror volume)!

Cheers all!

Post Reply

Return to “Basic storage concept”