[Solved] Sata mount disk stopping

Kernels & Hardware, configuring network, installing services

[Solved] Sata mount disk stopping

Postby coppolino97 » 2019-11-23 13:55

Hello,
I have an issue with a sata disk.
On this sata disk I have some shared folder with samba in my LAN.

I have created a simple script in the past, and it worked fine, but disk mounting doesn't work.

This is my simple script:
Code: Select all
#!/bin/bash
mount /dev/sda1 /media/disk1 > log.txt


I tried to execute this script today, but I get this error:
Code: Select all
mount: wrong fs type, bad option, bad superblock on /dev/sda1,missing codepage or helper program, or other error
In some cases useful info is found in syslog - try dmesg | tail or so.


This script runs automatically at startup.

After all the disk works fine, due to I have connected this sata drive using a sata to usb adapter and I can use it without problem.

Has got someone any ideas to solve my problem? :)
Last edited by coppolino97 on 2019-11-24 13:29, edited 2 times in total.
HP Elitebook 840 G3 | 8Gbyte of RAM | Intel core i5 | SSD 250GB | Debian 10
coppolino97
 
Posts: 50
Joined: 2018-06-05 15:23

Re: Sata mount disk stopping

Postby CwF » 2019-11-23 14:15

In the script it would be better IMHO to not use /dev/sda1. Give the disk a label and use /dev/disk/by-label/samba_disk or something...or use its uuid, anything but sda1.

What is the result when you manually mount the disk?
It may need a fsck.
CwF
 
Posts: 511
Joined: 2018-06-20 15:16

Re: Sata mount disk stopping

Postby coppolino97 » 2019-11-23 18:08

Hi,
I have done this steps:

1) Get the UUID of my sata drive in this way:
Code: Select all
sudo blkid


and I have this output:
Code: Select all
/dev/sda1: UUID="a3c88ac7-2aaa-457f-92e5-e2c9053f17d7" TYPE="ext4" PARTUUID="435b45a0-01"


So I have tried with
Code: Select all
sudo mount UUID=a3c88ac7-2aaa-457f-92e5-e2c9053f17d7 /mnt/folder


I get this output:
Code: Select all
mount: wrong fs type, bad option, bad superblock on /dev/sda1,
       missing codepage or helper program, or other error

       In some cases useful info is found in syslog - try
       dmesg | tail or so.



Thanks for your help
HP Elitebook 840 G3 | 8Gbyte of RAM | Intel core i5 | SSD 250GB | Debian 10
coppolino97
 
Posts: 50
Joined: 2018-06-05 15:23

Re: Sata mount disk stopping

Postby Head_on_a_Stick » 2019-11-23 18:10

What is the filesystem? Do you have the relevant utilities installed?
Don't break DebianHow to report bugs

SharpBang GNU/Linux® — a pre-configured Openbox/Tint2 desktop running on Debian stable
User avatar
Head_on_a_Stick
 
Posts: 10695
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Sata mount disk stopping

Postby p.H » 2019-11-23 18:15

coppolino97 wrote:This script runs automatically at startup.

Why then don't you mount the disk in /etc/fstab ?

coppolino97 wrote:I tried to execute this script today, but I get this error:

You must look at the kernel logs with dmesg to see the real error message.

CwF wrote:it would be better IMHO to not use /dev/sda1. Give the disk a label

I fully agree. /dev/sd* are not reliable persistent identifiers.
CwF wrote:and use /dev/disk/by-label/samba_disk

Or the shorter notation LABEL=samba_disk.

Head_on_a_Stick wrote:What is the filesystem?

blkid says it is ext4. The kernel log will tell what's wrong.
p.H
 
Posts: 1185
Joined: 2017-09-17 07:12

Re: Sata mount disk stopping

Postby coppolino97 » 2019-11-24 13:28

I have solved my problem using your suggestions!
Thanks so much.

I have done this steps:

1) Check log in /var/log/kern.log
Code: Select all
 sudo less /var/log/kern.log
and I get this errors:
Code: Select all
Nov 23 20:15:45 hostname kernel: [18077.309580] JBD2: Unrecognised features on journal
Nov 23 20:15:45 hostname kernel: [18077.309605] EXT4-fs (sda1): error loading journal


2) I have login as root user, and I have seen all partition and disk connected to my computer using this command:
Code: Select all
fdisk -l
In my case my partition is "/dev/sda1"

3) I have removed and create again journal in Ext4 filesystem using this two commads:
Code: Select all
tune2fs -O ^has_journal /dev/sda1
tune2fs -O has_journal /dev/sda1


4) Disk mounting works fine now!

Finally I am using /etc/fstab and UUID disk.

Thanks so much for your help! :D
HP Elitebook 840 G3 | 8Gbyte of RAM | Intel core i5 | SSD 250GB | Debian 10
coppolino97
 
Posts: 50
Joined: 2018-06-05 15:23


Return to System configuration

Who is online

Users browsing this forum: No registered users and 15 guests

fashionable