Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

(SOLVED) Trying to repair an HD, need some explanations.

Need help with peripherals or devices?
Post Reply
Message
Author
User avatar
Danielsan
Posts: 659
Joined: 2010-10-10 22:36
Has thanked: 5 times

(SOLVED) Trying to repair an HD, need some explanations.

#1 Post by Danielsan »

Hi guys,

for some reason the RPI2 hd got damaged, now I am trying to fix it.

These are the partions:

Code: Select all

Disk /dev/sdb: 4.6 TiB, 5000981073920 bytes, 1220942645 sectors
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x000b46b3

Device     Boot   Start        End    Sectors  Size Id Type
/dev/sdb1          2048 1220941823 1220939776  4.6T  5 Extended
/dev/sdb5          2816    3934975    3932160   15G 83 Linux
/dev/sdb6       3935744 1220941055 1217005312  4.5T 83 Linux
Sdb5 and sdb6 are fine, my only concern is sda1:

Code: Select all

sudo fsck /dev/sdb1
fsck from util-linux 2.29
e2fsck 1.43.3 (04-Sep-2016)
ext2fs_open2: Bad magic number in super-block
fsck.ext2: Superblock invalid, trying backup blocks...
fsck.ext2: Bad magic number in super-block while trying to open /dev/sdb1

The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem.  If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
    e2fsck -b 8193 <device>
 or
    e2fsck -b 32768 <device>

Found a dos partition table in /dev/sdb1
Can I use fsck on an extended partition or must I use a different tool?

Thanks
Last edited by Danielsan on 2017-01-06 04:20, edited 1 time in total.

User avatar
dilberts_left_nut
Administrator
Administrator
Posts: 5346
Joined: 2009-10-05 07:54
Location: enzed
Has thanked: 13 times
Been thanked: 66 times

Re: Trying to repair an HD, need some explanations.

#2 Post by dilberts_left_nut »

No.
sda1 is effectively just a container for your logical partitions sda5 & 6
AdrianTM wrote:There's no hacker in my grandma...

User avatar
Danielsan
Posts: 659
Joined: 2010-10-10 22:36
Has thanked: 5 times

Re: Trying to repair an HD, need some explanations.

#3 Post by Danielsan »

dilberts_left_nut wrote:No.
sda1 is effectively just a container for your logical partitions sda5 & 6
However seems the filesystem is corrupted, I see the files but I can't open or read them.
Anyway I used this command but the output doesn't make sense for me...

Code: Select all

sudo dosfsck /dev/sdb1
fsck.fat 4.0 (2016-05-06)
Logical sector size is zero.
EDIT

I tried to open the files directly from the drive, and fortunately they aren't corrupted (fiuuuu), however I am still unable to run OSMC.

User avatar
bw123
Posts: 4015
Joined: 2011-05-09 06:02
Has thanked: 1 time
Been thanked: 28 times

Re: Trying to repair an HD, need some explanations.

#4 Post by bw123 »

dilberts_left_nut wrote:
No.
sda1 is effectively just a container for your logical partitions sda5 & 6



However seems the filesystem is corrupted, I see the files but I can't open or read them.
It's okay, there's no filesystem on an extended partition. If 5 and 6 are working correctly, that's all you got.

P.s. I used gdisk a few months ago on all my dos partition tables and converted to GPT. Now I'm thinking GPT is a lot easier and simpler. That extended partition stuff always was a bunch of nonsense.
resigned by AI ChatGPT

User avatar
dilberts_left_nut
Administrator
Administrator
Posts: 5346
Joined: 2009-10-05 07:54
Location: enzed
Has thanked: 13 times
Been thanked: 66 times

Re: Trying to repair an HD, need some explanations.

#5 Post by dilberts_left_nut »

Danielsan wrote:I see the files but I can't open or read them.
What files?
How do you "see" them?
I tried to open the files directly from the drive
Can you explain further?
, and fortunately they aren't corrupted (fiuuuu), however I am still unable to run OSMC.
What is OSMC?
AdrianTM wrote:There's no hacker in my grandma...

User avatar
Danielsan
Posts: 659
Joined: 2010-10-10 22:36
Has thanked: 5 times

Re: Trying to repair an HD, need some explanations.

#6 Post by Danielsan »

I am sorry I was speaking how you know everything, I am such a stupid...

My RPI2 has a unique os: OSMC (basically Kodi on top Debian Stable). OSMC is mounted on an external drive (pretty uncommon for the Pi's) and it serves also as samba server. For some reason, Samba was broken, I was able to fix it through the ssh connection. When I re-enabled Samba I was able to mount the partition and browse through the folders and see the files inside (mostly pictures) but I was unable to copy or open them. I was convinced to have some harddrive corruption but when I mounted through USB3 this HD I was able to open, see and copy all the files (fortunately) so at least the files weren't corrupted.

After fsck I checked the partitions are fine, now I launched a badblocks checking, so now after this last check I have to try to fix OSMC, that's all.

User avatar
pylkko
Posts: 1802
Joined: 2014-11-06 19:02

Re: Trying to repair an HD, need some explanations.

#7 Post by pylkko »

Are you booting of the usb also? Because if the root is only on the USB HD, then you don't need to use a MBR partition table, you can GPT, AFAIK. When you say you are unable to run OSMC (a Raspbian based htpc OS) what exactly happens? Can it not find root or does the bootloader not even load?

User avatar
Danielsan
Posts: 659
Joined: 2010-10-10 22:36
Has thanked: 5 times

Re: Trying to repair an HD, need some explanations.

#8 Post by Danielsan »

Hi guys, as first none of the hard drive was corrupted. It was happened that some heavy folders were kept back on the media folder filling the root partition of the PI2, this broke everything but eventually I was able to fix it. Unfortunately I learned the PI is very unreliable to do very heavy files transfer, for example every time my wife takes the camera she fills almost 64giga of memory and we have a plenty of giga to backup every time. The pi is not the only medium we use to backup file (we are currently spreading on three drives, the pi2 is one of them) but as nas eventually is slow for transferring files, it's good as media player but as nas I will never use it as primary back-up destination.

Post Reply