Hello :)
Thank you for putting this guide together.
I found it from this thread after I experienced the following error on my Synology:
synology System ran [ext4 filesystem check & repairing] on [Volume 1]. Exit code: [4]
The error appeared when Storage Manager found errors on Volume1 and recommended run a file system check (however, the NAS seems to behave normally outside from the warning).
I had a relatively hard time to follow your instructions since I am not fully familiar with the commands. I used putty to SSH into my NAS.
Here are some suggestions and the error I got at some point down the line.
-
"SSH To your synology and sudo to root:" -> You way a want to mention that "sudo -i" will sudo to root
-
"Disable all services and unmount volume: This will log out!" -> You may want to mention log out from what. I wasn't logged out of anything. Not from DSM GUI, not from putty. Maybe this is the source of my problem. In my case the result of synospace --stop-all-spaces was that volume1 crashed and all drives were now in the state detected. Storage Manager suggesting to perform Online Assemble.
-
"Log back in and check that your volume is not mounted, no lvm, mdstat empty" -> You may want to mention what the output of the 3 commands should be (what should we check for). In my case, the output of mount was:
/dev/md0 on / type ext4 (rw,relatime,prjquota,rootprjquota,data=ordered)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
devtmpfs on /dev type devtmpfs (rw,nosuid,size=3887252k,nr_inodes=971813,mode=755)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nodev,mode=755)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd)
cgroup on /sys/fs/cgroup/synomonitor type cgroup (rw,nosuid,nodev,noexec,relatime,name=synomonitor)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/cpu type cgroup (rw,nosuid,nodev,noexec,relatime,cpu)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpuacct)
debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noexec)
configfs on /sys/kernel/config type configfs (rw,nosuid,nodev,noexec,relatime)
devtmpfs on /proc/bus/usb type devtmpfs (rw,nosuid,size=3887252k,nr_inodes=971813,mode=755)
none on /config type configfs (rw,nosuid,nodev,noexec,relatime)
This seems not as what I should expect, right? or is it OK?
lvm lvscan generated no output in the putty
cat /proc/mdstat output was:
Personalities : [raid1] [raid6] [raid5] [raid4] [raidF1]
md1 : active raid1 sda2[0] sdi2[7] sdh2[6] sdg2[5] sdf2[4] sde2[3] sdc2[1]
2097088 blocks [16/7] [UU_UUUUU________]
md0 : active raid1 sda1[0] sdi1[7] sdh1[6] sdg1[5] sdf1[4] sde1[3] sdc1[1]
8388544 blocks [16/7] [UU_UUUUU________]
unused devices:
-
"After it comes back online your volume should be unmounted" -> In my case if was mounted though :( Now the state of the volume is "Critical"
-
"(5 minutes after ssh is up)" -> what does that mean?
-
"run the commands above to make sure you are not mounted and lvm sees your lvm" -> what output should we expect?
-
"Run this command to see your mapper path to fsck: dmsetup table" -> in my case the output was:
vg1-syno_vg_reserved_area: 0 24576 linear 9:2 1152
cachedev_0: 0 163913400320 flashcache-syno conf:
ssd dev (none), disk dev (/dev/vg1/volume_1) cache mode(DUMMY)
capacity(0M), associativity(0), data block size(0K)
skip sequential thresh(0K)
total blocks(0), cached blocks(0), cache percent(0)
nr_queued(0)
split-io(0) support pin file(0) version(0)
Size Hist:
bits_all=0 bits_used=0
vg1-volume_1: 0 163913400320 linear 9:2 25728
- "fsck.ext4 -yvf -C 0 /dev/mapper/cachedev_0" -> (should I replace mapper with something else?) in my case the output was some error message. After running the whole thing a second time Fsck started doing something:
e2fsck 1.44.1 (24-Mar-2018)
Pass 1: Checking inodes, blocks, and sizes
Inode 1120896046 has an invalid extent
(logical block 0, invalid physical block 0, len 0)
Clear? yes
Failed to iterate extents in inode 1120896046
(op ext2fs_extent_fix_parents, blk 0, lblk 0): Extent not found
Clear inode? yes
1.44.1-42661: e2fsck canceled.
1.44.1-42661: ***** FILE SYSTEM WAS MODIFIED *****
1.44.1-42661: ********** WARNING: Filesystem still has errors **********
Then I ran Fsck again as suggested from the post of thedenetor on this thread.
In the end the output was:
e2fsck 1.44.1 (24-Mar-2018)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Entry 'Thumbs.db' in /folder1/folder2/folder3/folder4 (1120895818) has deleted/unused inode 1120896046. Clear? yes
Pass 3: Checking directory connectivity
/lost+found not found. Create? yes
Pass 4: Checking reference counts
Pass 5: Checking group summary information
Block bitmap differences: -(11853--11931) -(11743560225--11743560232) -(11749505225--11749505322) -(11749505344--11749505505) -(11749505520--11749505758) -(11749505760--11749505774) -(11749505984--11749505998) -(11749506000--11749506045) -(11749513655--11749513716) -(11749513984--11749514003) -(11749514016--11749514047) -17934360505
Fix? yes
Free blocks count wrong for group #0 (20836, counted=20915).
Fix? yes
Free blocks count wrong for group #358385 (32725, counted=32733).
Fix? yes
Free blocks count wrong for group #358566 (10904, counted=11593).
Fix? yes
Free blocks count wrong for group #547313 (31697, counted=31698).
Fix? yes
Free blocks count wrong (20054960287, counted=20054961064).
Fix? yes
Inode bitmap differences: -1120896046
Fix? yes
Free inodes count wrong for group #547312 (1230, counted=1231).
Fix? yes
Free inodes count wrong (1280298131, counted=1280298132).
Fix? yes
1.44.1-42661: ***** FILE SYSTEM WAS MODIFIED *****
275308 inodes used (0.02%, out of 1280573440)
4412 non-contiguous files (1.6%)
120 non-contiguous directories (0.0%)
# of inodes with ind/dind/tind blocks: 0/0/0
Extent depth histogram: 274960/326
434213976 blocks used (2.12%, out of 20489175040)
0 bad blocks
142 large files
253153 regular files
22132 directories
0 character device files
0 block device files
0 fifos
0 links
13 symbolic links (13 fast symbolic links)
0 sockets
However, when going on with the guide,
mount volume1 -> mount: volume1: can't find in /etc/fstab.
- "Run some Synology specific checks and verify we're mounted:" -> You may want to mention what the output of the 5 commands should be (what should we check for).
After rebooting my Synology, I was able to run File System check from Storage Manger (-> no errors) and then Data scrubbing). :)