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] i edit my fstab and now i lost my system

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
User avatar
DRAGSTER_TUNER
Posts: 25
Joined: 2010-03-28 13:30
Location: Brazil

[SOLVED] i edit my fstab and now i lost my system

#1 Post by DRAGSTER_TUNER »

Hi everyone!

I was editing my fstab and i made a dumb

I was editing fstab because im using an ssd hd, só i wish to put noatime in the respective line

BUT........ when i was editing, i leave the end of line like that:

noatime,errors 0 0

Instead

noatime,errors=remount-ro 0 0

And now i cant access the hd, even using another debian i have on the other HD.

When i try mount gimme this error:

An error has ocurred accessing hard disk 217,6 GiB', system says: The requested operation has failed: Error mounting system-managed device /dev/sdb1: Command-line `mount "/media/supercharger"' exited with non-zero exit status 32: mount: wrong fs type, bad option, bad superblock on /dev/sdb1, missing codepage or helper program, or other error In some cases useful info is found in syslog - try dmesg | tail or so.

And now i cant access the HD to edit fstab again... someone can help me?
Last edited by DRAGSTER_TUNER on 2018-10-16 23:31, edited 1 time in total.

arochester
Emeritus
Emeritus
Posts: 2435
Joined: 2010-12-07 19:55
Has thanked: 14 times
Been thanked: 54 times

Re: i edit my fstab and now i lost my system

#2 Post by arochester »

Boot from a LiveCD and repair?

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

Re: i edit my fstab and now i lost my system

#3 Post by bw123 »

Show us the command in terminal that you use to mount the partition with the fstab you want to edit. Might help to also show the partition layout with blkid or fdisk -l command.

use code tags for output, please.

Code: Select all

# blkid
# fdisk -l
# mount [-fnrsvw] [-t fstype] [-o options] device dir
I do this now and then, don't stab at it. Think it through. Use a terminal.
resigned by AI ChatGPT

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

Re: i edit my fstab and now i lost my system

#4 Post by Head_on_a_Stick »

DRAGSTER_TUNER wrote:i wish to put noatime in the respective line
There is no need to make special arrangements for modern SSDs, they will likely outlast their spinning rust equivalents.

Anyway, relatime has been the default for ext4 since kernel 2.6.something and that would be quite sufficient.

Code: Select all

An error has ocurred accessing hard disk 217,6 GiB', system says: The requested operation has failed: Error mounting system-managed device /dev/sdb1: Command-line `mount "/media/supercharger"' exited with non-zero exit status 32: mount: wrong fs type, bad option, bad superblock on /dev/sdb1, missing codepage or helper program, or other error In some cases useful info is found in syslog - try dmesg | tail or so.
Do you have the filesystem tools installed in the environment from which you are attempting to mount the partition?

For ext4 that would be https://packages.debian.org/stretch/e2fsprogs
deadbang

User avatar
DRAGSTER_TUNER
Posts: 25
Joined: 2010-03-28 13:30
Location: Brazil

Re: i edit my fstab and now i lost my system

#5 Post by DRAGSTER_TUNER »

bw123:

Code: Select all

blkid
/dev/sdb1: UUID="5d8607cc-5bbd-4442-ad08-82bcc61c9d72" TYPE="ext4" PARTUUID="9831b998-01"
/dev/sdb5: UUID="d6b838d9-ad63-441d-8744-3f1776a30b37" TYPE="swap" PARTUUID="9831b998-05"
/dev/sda1: UUID="69003405-9ab9-4b96-b20d-2e0831ec816e" TYPE="ext4" PARTUUID="0004a750-01"
/dev/sda2: UUID="8f7b1158-831e-4c71-ac80-b2477c53e5be" TYPE="swap" PARTUUID="0004a750-02"
root@supercharger:/home/supercharger# fdisk -l
Disco /dev/sdb: 223,6 GiB, 240057409536 bytes, 468862128 setores
Unidades: setor de 1 * 512 = 512 bytes
Tamanho de setor (lógico/físico): 512 bytes / 512 bytes
Tamanho E/S (mínimo/ótimo): 512 bytes / 512 bytes
Tipo de rótulo do disco: dos
Identificador do disco: 0x9831b998

Dispositivo Inicializar   Início       Fim   Setores Tamanho Id Tipo
/dev/sdb1   *                2048 456282111 456280064  217,6G 83 Linux
/dev/sdb2               456284158 468860927  12576770      6G  5 Estendida
/dev/sdb5               456284160 468860927  12576768      6G 82 Linux swap / Solaris


Disco /dev/sda: 298,1 GiB, 320072933376 bytes, 625142448 setores
Unidades: setor de 1 * 512 = 512 bytes
Tamanho de setor (lógico/físico): 512 bytes / 512 bytes
Tamanho E/S (mínimo/ótimo): 512 bytes / 512 bytes
Tipo de rótulo do disco: dos
Identificador do disco: 0x0004a750

Dispositivo Inicializar   Início       Fim   Setores Tamanho Id Tipo
/dev/sda1   *                2048 599980031 599977984  286,1G 83 Linux
/dev/sda2               599982080 625141759  25159680     12G 82 Linux swap / Solaris
I didnt get how to use the parameters of the mount command, so i didnt try mount it with that sintaxes...

Head_on_a_Stick:

I think i have the filesystem tools installed, since the OS was working ok before i change the fstab...i dont know if it indicates the system have this package installed...

And about the realtime, even the realtime option wasnt on the line i edited...so thats because i realize put the noatime on the ssd line...

arochester:

I didnt try it...but i guess it will not works...

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

Re: i edit my fstab and now i lost my system

#6 Post by bw123 »

Are you saying that you do not understand how to mount a partition from a terminal?
resigned by AI ChatGPT

User avatar
GarryRicketson
Posts: 5644
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: i edit my fstab and now i lost my system

#7 Post by GarryRicketson »

I think that is the problem, the OP needs a copy/paste example, based on the info they gave, or they could look at the manual:

Code: Select all

man  mount
I think it explains pretty well.
--some thing like

Code: Select all

# mount /dev/sda1  /mnt 
Maybe ? for the options, one really needs to read the manual, and I don't have the Debian manual handy at this moment. The # is not part of the command, it indicates this must be done as root or using sudo.

This seems odd to me:
arochester:

I didnt try it...but i guess it will not works...
Because, how can some one "guess it will not work" if they don't even try?
If the OP can not access or boot the system, they will need to boot with a live CD or Live usb device, so they can access from a terminal. Maybe the OP needs some explanation on that.
I think maybe there is some communication problem as well due to language and the way a machine translator translates, ?

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

Re: i edit my fstab and now i lost my system

#8 Post by Head_on_a_Stick »

DRAGSTER_TUNER wrote:I think i have the filesystem tools installed
Please post the full output of these two commands:

Code: Select all

apt policy e2fsprogs
wipefs /dev/sdb1
deadbang

User avatar
DRAGSTER_TUNER
Posts: 25
Joined: 2010-03-28 13:30
Location: Brazil

Re: i edit my fstab and now i lost my system

#9 Post by DRAGSTER_TUNER »

Code: Select all

apt-cache policy e2fsprogs
e2fsprogs:
  Instaled: 1.43.1-1
  Candidate: 1.43.1-1
  version:
 *** 1.43.1-1 0
        100 /var/lib/dpkg/status

Code: Select all

wipefs /dev/sdb1
offset               type
----------------------------------------------------------------
0x438                ext4   [filesystem]
                     UUID:  5d8607cc-5bbd-4442-ad08-82bcc61c9d72

Segfault
Posts: 993
Joined: 2005-09-24 12:24
Has thanked: 5 times
Been thanked: 17 times

Re: i edit my fstab and now i lost my system

#10 Post by Segfault »

Amazing how a simple trivial task can be made so sophisticated. :shock:

This is what I'd do.
1. Boot from an external media. SysRescueCD is my favorite and always ready in a USB stick.
2. Mount the root filesystem. Make sure it is mounted read-write. If it is ro then investigate why, fix the problem and remount rw.
3. Edit the fstab.

Done!

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

Re: i edit my fstab and now i lost my system

#11 Post by Head_on_a_Stick »

Segfault wrote:Amazing how a simple trivial task can be made so sophisticated
Thanks :mrgreen:

The OP has already tried mounting the partition, that is where the error message I quoted originated.

@OP: try

Code: Select all

# fsck /dev/sdb1
A simple web search of the error message would have told you to try this:

https://unix.stackexchange.com/question ... superblock

See also http://forums.debian.net/viewtopic.php?f=30&t=47078
deadbang

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

Re: i edit my fstab and now i lost my system

#12 Post by bw123 »

still haven't seen the mount command used that caused the error? Looked like some filemanager or fronted was trying to mount /media/superjammer or something?

'system-managed device' sounds like a gnome thing?
resigned by AI ChatGPT

Segfault
Posts: 993
Joined: 2005-09-24 12:24
Has thanked: 5 times
Been thanked: 17 times

Re: i edit my fstab and now i lost my system

#13 Post by Segfault »

Our OP has been around for 8+ years. One would expect at least some degree of proficiency by now. Not sure what is wrong here, the language barrier perhaps?

User avatar
DRAGSTER_TUNER
Posts: 25
Joined: 2010-03-28 13:30
Location: Brazil

Re: i edit my fstab and now i lost my system

#14 Post by DRAGSTER_TUNER »

Segfault wrote:Amazing how a simple trivial task can be made so sophisticated. :shock:

This is what I'd do.
1. Boot from an external media. SysRescueCD is my favorite and always ready in a USB stick.
2. Mount the root filesystem. Make sure it is mounted read-write. If it is ro then investigate why, fix the problem and remount rw.
3. Edit the fstab.

Done!
Silly silly silly issue! Just used SysRescueCD and mounted the HD....entered in the /etc/fstab and edited!

Done.

Thanks for everyone whos helped me out!

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

Re: [SOLVED] i edit my fstab and now i lost my system

#15 Post by Head_on_a_Stick »

Can you now chroot into the formerly broken system from the other Debian on the disk?

It seems silly to have to load a live ISO when you already have another distribution bootable from the disk.
deadbang

User avatar
DRAGSTER_TUNER
Posts: 25
Joined: 2010-03-28 13:30
Location: Brazil

Re: [SOLVED] i edit my fstab and now i lost my system

#16 Post by DRAGSTER_TUNER »

Head_on_a_Stick wrote:Can you now chroot into the formerly broken system from the other Debian on the disk?

It seems silly to have to load a live ISO when you already have another distribution bootable from the disk.
Indeed!

I cant guarantee i was doing something wrong when try to access the broken system by the other working debian. I think what solved the issue was the -rw option i used in the mount command (guess)

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

Re: [SOLVED] i edit my fstab and now i lost my system

#17 Post by Head_on_a_Stick »

Ah, I see, so @bw123 was on the right track all along, lesson learned there (hopefully).

Thanks for the comeback :)
deadbang

User avatar
DRAGSTER_TUNER
Posts: 25
Joined: 2010-03-28 13:30
Location: Brazil

Re: [SOLVED] i edit my fstab and now i lost my system

#18 Post by DRAGSTER_TUNER »

Head_on_a_Stick wrote:Ah, I see, so @bw123 was on the right track all along, lesson learned there (hopefully).

Thanks for the comeback :)
Yes, i think he was right, it was just mount it with the right option....in this case, a mandatory -rw option.

Post Reply