0

I created a LVM volume using this guide I have 2x2TB HDDs for a total of 4TB (or 3.64TB usable). I created the volume and rebooted. Everything was working fine. Then I copied 1.6TB of data on the volume, and after restarting, the volume can't mount. Here's the output while booting:

...
[....] Checking file system...fsck from util-linux 2.20.1
/dev/mapper/vgpool-lvstuff: One or more block group descriptor checksums are invalid. FIXED.
/dev/mapper/vgpool-lvstuff: Group descriptor 24704 checksum is 0x4357, should be 0x0228.

/dev/mapper/vgpool-lvstuff: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.
(i.e., without -a or -p options)
fsck died with exit status 4
failed (code 4).
[FAIL] File system check failed. A log is being saved in /var/log/fsck/checkfs if that location is writeable. Please repair the file system manually. ... failed!
[warn] A maintenance shell will now be started. CONTROL-D will terminatethis shell and resume system boot. ... (warning).
Give root password for maintenance (or type Control-D to continue):

This has happened me three times now and I can't find the issue. I had already tried a fsck -y last time but it kept fixing and fixing blocks, and in the end tha data was all lost.

This is the content of /var/log/fsck/checkfs:

    Log of fsck -C -R -A -a
Sun Nov 16 20:18:36 2014

fsck from util-linux 2.20.1
/dev/mapper/vgpool-lvstuff: One or more block group descriptor checksums are in$
/dev/mapper/vgpool-lvstuff: Group descriptor 24704 checksum is 0x4357, should b$

/dev/mapper/vgpool-lvstuff: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.
        (i.e., without -a or -p options)
fsck died with exit status 4

Sun Nov 16 20:18:36 2014
----------------

The HDDs worked fine between the data was copied and the reboot. The read/write speeds were good, and all the files I opened worked without issues. I don't think it's a hardware problem. Is there something I can do to restore the LVM volume?
I should specify that I'm running Debian 7.

Output of command fdisk -l /dev/sd[ab]:

root@nas-debian:~# fdisk -l /dev/sd[ab]

Disk /dev/sda: 2000.4 GB, 2000398934016 bytes
81 heads, 63 sectors/track, 765633 cylinders, total 3907029168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x000deed2

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048  3907029167  1953513560   8e  Linux LVM

Disk /dev/sdb: 2000.4 GB, 2000398934016 bytes
81 heads, 63 sectors/track, 765633 cylinders, total 3907029168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x5dc840bf

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048  3907029167  1953513560   8e  Linux LVM

smartctl -A /dev/sda

root@nas-debian:~# smartctl -A /dev/sda
smartctl 5.41 2011-06-09 r3365 [x86_64-linux-3.2.0-4-amd64] (local build)
Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF READ SMART DATA SECTION ===
SMART Attributes Data Structure revision number: 10
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x000f   113   099   006    Pre-fail  Always       -       55599712
  3 Spin_Up_Time            0x0003   093   091   000    Pre-fail  Always       -       0
  4 Start_Stop_Count        0x0032   096   096   020    Old_age   Always       -       4866
  5 Reallocated_Sector_Ct   0x0033   100   100   036    Pre-fail  Always       -       0
  7 Seek_Error_Rate         0x000f   066   060   030    Pre-fail  Always       -       4984356
  9 Power_On_Hours          0x0032   093   093   000    Old_age   Always       -       6737
 10 Spin_Retry_Count        0x0013   100   100   097    Pre-fail  Always       -       0
 12 Power_Cycle_Count       0x0032   100   100   020    Old_age   Always       -       29
183 Runtime_Bad_Block       0x0032   100   100   000    Old_age   Always       -       0
184 End-to-End_Error        0x0032   100   100   099    Old_age   Always       -       0
187 Reported_Uncorrect      0x0032   100   100   000    Old_age   Always       -       0
188 Command_Timeout         0x0032   100   100   000    Old_age   Always       -       0
189 High_Fly_Writes         0x003a   100   100   000    Old_age   Always       -       0
190 Airflow_Temperature_Cel 0x0022   063   043   045    Old_age   Always   In_the_past 37 (1 97 37 33)
191 G-Sense_Error_Rate      0x0032   100   100   000    Old_age   Always       -       0
192 Power-Off_Retract_Count 0x0032   100   100   000    Old_age   Always       -       11
193 Load_Cycle_Count        0x0032   098   098   000    Old_age   Always       -       4866
194 Temperature_Celsius     0x0022   037   057   000    Old_age   Always       -       37 (0 19 0 0)
195 Hardware_ECC_Recovered  0x001a   021   003   000    Old_age   Always       -       55599712
197 Current_Pending_Sector  0x0012   100   100   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0010   100   100   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x003e   200   200   000    Old_age   Always       -       0
240 Head_Flying_Hours       0x0000   100   253   000    Old_age   Offline      -       144877836830620
241 Total_LBAs_Written      0x0000   100   253   000    Old_age   Offline      -       2043681280
242 Total_LBAs_Read         0x0000   100   253   000    Old_age   Offline      -       4265209040

smartctl -A /dev/sdb

root@nas-debian:~# smartctl -A /dev/sdb
smartctl 5.41 2011-06-09 r3365 [x86_64-linux-3.2.0-4-amd64] (local build)
Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF READ SMART DATA SECTION ===
SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x002f   187   187   051    Pre-fail  Always       -       3744
  3 Spin_Up_Time            0x0027   168   163   021    Pre-fail  Always       -       6591
  4 Start_Stop_Count        0x0032   100   100   000    Old_age   Always       -       219
  5 Reallocated_Sector_Ct   0x0033   178   178   140    Pre-fail  Always       -       421
  7 Seek_Error_Rate         0x002e   200   200   000    Old_age   Always       -       0
  9 Power_On_Hours          0x0032   081   081   000    Old_age   Always       -       13981
 10 Spin_Retry_Count        0x0032   100   100   000    Old_age   Always       -       0
 11 Calibration_Retry_Count 0x0032   100   253   000    Old_age   Always       -       0
 12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       92
192 Power-Off_Retract_Count 0x0032   200   200   000    Old_age   Always       -       63
193 Load_Cycle_Count        0x0032   117   117   000    Old_age   Always       -       250860
194 Temperature_Celsius     0x0022   111   098   000    Old_age   Always       -       39
196 Reallocated_Event_Count 0x0032   001   001   000    Old_age   Always       -       400
197 Current_Pending_Sector  0x0032   196   196   000    Old_age   Always       -       1418
198 Offline_Uncorrectable   0x0030   200   198   000    Old_age   Offline      -       4
199 UDMA_CRC_Error_Count    0x0032   200   200   000    Old_age   Always       -       0
200 Multi_Zone_Error_Rate   0x0008   197   001   000    Old_age   Offline      -       1023

df -h

root@nas-debian:~# df -h
Filesystem                                              Size  Used Avail Use% Mounted on
rootfs                                                   57G   14G   41G  25% /
udev                                                     10M     0   10M   0% /dev
tmpfs                                                   797M  1.8M  795M   1% /run
/dev/disk/by-uuid/df7e64db-f3a7-40da-88ec-1f63dfa8b699   57G   14G   41G  25% /
tmpfs                                                   5.0M     0  5.0M   0% /run/lock
tmpfs                                                   2.1G  236K  2.1G   1% /run/shm

pvs

root@nas-debian:~# pvs
  PV         VG     Fmt  Attr PSize PFree
  /dev/sda1  vgpool lvm2 a--  1.82t    0
  /dev/sdb1  vgpool lvm2 a--  1.82t    0

vgs

root@nas-debian:~# vgs
  VG     #PV #LV #SN Attr   VSize VFree
  vgpool   2   1   0 wz--n- 3.64t    0

lvs

root@nas-debian:~# lvs
  LV      VG     Attr     LSize Pool Origin Data%  Move Log Copy%  Convert
  lvstuff vgpool -wi-a--- 3.64t
  • Have you created an underlying RAID? What does fdisk -l /dev/sd[abc] output? What about pvs, vgs, lvs? – Marki Nov 16 '14 at 19:59
  • I have not created a RAID with the two disks. Should I have? I thought the main advantage of LVM was to easily add disks without having to worry about formatting disks and recreating arrays. By the way, the guide explains how to add a second HDD under the "Add New Hard Drive to Volume Group" section. I will add the output of the command in my question right now. – Nicolas Realini Nov 16 '14 at 20:03
  • Note that you can run the Debian installer for setting up LVMs. No, you do not need to create a RAID array, but beware, the more disks you add the way you do here, it only takes one disk to loose all the data (all disks). Just to make sure could you also post smartctl -A /dev/sda and smartctl -A /dev/sdb, also df -h, pvs, vgs, and lvs please. Is it certain you created an Ext3 in the first place? (Since later you run resize2fs) – Marki Nov 16 '14 at 20:12
  • I may try setting up LVM during the install if I can't solve the issue. I am aware of the issues with LVM, but there is no important data on the HDDs and I regularly back the data up anyways. The LVM volume I created is ext4, not ext3, since it's newer. Does LVM not support ext4? I thought that when the guide was written, ext4 wasn't widely used yet. I added the outputs of the commands you requested. – Nicolas Realini Nov 16 '14 at 20:22
  • LVM doesn't care about the filesystem inside later. I don't know for know. From here you could mkfs.ext4 /dev/mapper/vgpool-lvstuff again. (Data will be gone, but is already anyway.) Keep a log of your terminal so we can examine that for potential flaws. Also before rebooting the first time it would be interesting to see /var/log/messages as well as dmesg, in order to see if something is wrong already before rebooting. – Marki Nov 16 '14 at 20:34
1

Your /dev/sdb is clearly toast ( has tons of reallocated and pending bad sectors ). You need to replace it.

  • It's a WD Green that's been used and abused for 1.5+ years on a RPi NAS, so it may very well be broken. I'll get a 4TB WD Red or something like that. – Nicolas Realini Nov 16 '14 at 22:16
  • @NicolasRealini, AFAICS, red is the same as green, only with a 3 year warranty instead of only 2. Both are only 5900 rpm drives. I recommend staying clear of both red and green. – psusi Nov 17 '14 at 0:56
  • Red Pro then? What would you recommend? – Nicolas Realini Nov 17 '14 at 6:32
  • @NicolasRealini, last year I went with 3x Blues. They have perfectly respectable performance and reliability ( which is to say, quite a bit better than the greens and reds ). I run them in a mix of raid10 and raid5 so if one does die it won't bother me, and a linux raid10 in the offset layout gets me ~500 MB/s of sequential read, and the duplicate copies boost the performance of random reads a bit too. The red pro is really no different; they just charge more. – psusi Nov 17 '14 at 14:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.