LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-12-2013, 03:23 PM   #1
LaCaradeculito
LQ Newbie
 
Registered: Jun 2012
Posts: 16

Rep: Reputation: Disabled
Modified fstab and now I can't boot.


Hi.

Mine is maybe a typical case since there's so much to read about f'ing up fstab and then failing to restart. But I find no solution in all threads I've read because all instructions go directly to coding, and my comp doesn't give me an instance of terminal that may allow mounting the disk manually.

What I have is first a 'click' I hear, the same it does when I disable the hard drive (e.g. to run a live CD), and then a choice to run BIOS or "recovery". I find nothing related in BIOS, and the second option just lists the disk that doesn't boot and do nothing when I select/enter this line. I mean I don't reach any 'single user mode' by which many threads start from.

Any clue to recover my system?
Thanks a lot.
Marcelo.


(comp: Samsung series 5 Intel I5; OS: Debian standard installation + fluxbox)
 
Old 08-12-2013, 03:26 PM   #2
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora
Posts: 2,630

Rep: Reputation: 495Reputation: 495Reputation: 495Reputation: 495Reputation: 495
get a liveCD of types boot from that and mount the / or /root partition from the HDD, if you have multiple partitions and put /etc on its own partition that is what you need to mount.

From there you can edit the /etc/fstab to fix what you broke.
 
Old 08-12-2013, 03:34 PM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 14,961

Rep: Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530Reputation: 1530
At first glance this does not appear to be a fstab problem. What did you do to break the computer?
 
Old 08-12-2013, 06:02 PM   #4
LaCaradeculito
LQ Newbie
 
Registered: Jun 2012
Posts: 16

Original Poster
Rep: Reputation: Disabled
Thanks to both for the quick answer.

What I did to break the computer was to edit fstab in order to make a NTFS drive mounting automatically. I did it according to this tutorial

The only thing I imagine was wrong is I didn't specify UUID as the tutorial doesn't either.

And as for lleb's clue, I've been having lots of problems to make a correct read/write mount of the drive (newbie). Whatever, I could see fstab in nano but it didn't accept saving modifications. BTW could you tell me what exactly is the correct synthax? because this didn't work:

Code:
sudo mount -t ext4 -o rw /dev/sda1 mnt
where mnt is a folder I create to mount the drive.

Thanks very much.
 
Old 08-12-2013, 06:38 PM   #5
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora
Posts: 2,630

Rep: Reputation: 495Reputation: 495Reputation: 495Reputation: 495Reputation: 495
Quote:
Originally Posted by LaCaradeculito View Post
Thanks to both for the quick answer.

What I did to break the computer was to edit fstab in order to make a NTFS drive mounting automatically. I did it according to this tutorial

The only thing I imagine was wrong is I didn't specify UUID as the tutorial doesn't either.

And as for lleb's clue, I've been having lots of problems to make a correct read/write mount of the drive (newbie). Whatever, I could see fstab in nano but it didn't accept saving modifications. BTW could you tell me what exactly is the correct synthax? because this didn't work:

Code:
sudo mount -t ext4 -o rw /dev/sda1 mnt
where mnt is a folder I create to mount the drive.

Thanks very much.
you are close, give it an exact path for the mount point.

also check out autofs for mounting. this allows for mount/umount in an automatic way that is real simple to use.

Code:
mount -t ext4 -o rw /dev/sdb1 /mnt/foo
were foo is a specific folder.

look for these fields and commands:

Code:
[user@server ~]$ df -Th
Filesystem    Type    Size  Used Avail Use% Mounted on
/dev/mapper/vg_centos-lv_root
              ext4     50G  4.8G   42G  11% /
tmpfs        tmpfs    939M     0  939M   0% /dev/shm
/dev/sdb1     ext4    485M  144M  316M  32% /boot
/dev/mapper/vg_centos-lv_home
              ext4    1.8T  982G  709G  59% /exports/centos
/dev/sdc1     ext4    1.4T  764G  542G  59% /exports/NFS_TV_Shows
/dev/sda1     ext4    3.6T  971G  2.5T  28% /exports/New
[ray@centos ~]$ d /mnt/
total 20
drwxr-xr-x.  6 root root 4096 Apr 28 16:17 ./
dr-xr-xr-x. 27 root root 4096 Aug  7 19:06 ../
drwxr-xr-x.  2 root root 4096 Apr 28 16:17 cdrom/
drwxr-xr-x.  2 root root 4096 Jan  5  2013 usb/
drwxr-xr-x.  2 root root 4096 Jan  5  2013 usb2/
drwxr-xr-x.  3 root root    0 Aug  7 19:07 win7/
here are my auto.master and auto.win7 that i use to access a cifs share on a different computer. you can do the same thing for a local HDD.

Code:
[user@server ~]$ cat /etc/auto.master 
/net	-hosts

#
#	Direct Map
/-		/etc/auto.direct

#
#	Existing Win7 Indirect Map
/mnt/win7	/etc/auto.win7	--timeout=600	--ghost


+auto.master

[user@server ~]$ cat /etc/auto.win7 
win7	-fstype=cifs,rw,noperm,username=user,password=password	://win7/e
 
Old 08-12-2013, 10:55 PM   #6
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Debian Jessie, Linux Mint 17
Posts: 7,751

Rep: Reputation: 272Reputation: 272Reputation: 272
BTW could you tell me what exactly is the correct synthax? because this didn't work:

Code:
sudo mount -t ext4 -o rw /dev/sda1 mnt

The correct syntax is:

sudo mount -t ext4 /dev/sda1 /mnt

--------------------------
Steve Stites
 
Old 08-13-2013, 02:46 PM   #7
LaCaradeculito
LQ Newbie
 
Registered: Jun 2012
Posts: 16

Original Poster
Rep: Reputation: Disabled
My system's back! just in the way you said.

I still didn't edit fstab correctly, but it's a matter of time. I think I have enough info to do it. Thanks so much lleb. Thank you all for the support.
 
Old 08-13-2013, 02:56 PM   #8
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora
Posts: 2,630

Rep: Reputation: 495Reputation: 495Reputation: 495Reputation: 495Reputation: 495
welcome, what exact;y did you do to fix your problem, or at least get it bootable. this way others can learn when they search for this type of problem.
 
Old 08-15-2013, 05:17 PM   #9
LaCaradeculito
LQ Newbie
 
Registered: Jun 2012
Posts: 16

Original Poster
Rep: Reputation: Disabled
Sorry for the delay. This is what I did:

0. I broke fstab by editing it like this:

Code:
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>

# / was on /dev/sda3 during installation
UUID=1a7a3977-6977-486a-a915-73915bb0034b /               ext4    errors=remount-ro 0       1

# swap was on /dev/sda2 during installation
UUID=624e103e-20a9-4bda-a7a3-01bafa5b7c06 none            swap    sw              0       0
/dev/sdc1       /media/usb0     auto    rw,user,noauto  0       0

/dev/sda1 /media/ntfs ntfs-3g defaults 0 0
See the last line. I think it was that /dev/sda1 is not the ntfs partition I wanted to have it mounted automatically at start up but an ext4 with another filesystem, and of course is not in /media/ntfs. Whatever, I tried to break fstab again rewriting it all as you see above just to double-check that was indeed the trouble... and it didn't work! I won't try it again .

1. I restarted the computer, went to BIOS (F2 in may case, but just DEL while restarting in most other cases), and edited it so to:
- disable fast booting
- put usb drives above main HDD in the booting priority list.

2. I inserted the debian liveUSB I created to install the system, pressed F10 to save/quit BIOS and start again.

3. Debian liveUSB booted and I went "live" instead of "graphic install" or whatever other option. I got the famous debian single user line "user@debian:-$".

4. To check I could see the disks from the liveUSB I wrote:

Code:
$ sudo fdisk -l
... and then:

Code:
cd
mkdir mnt
sudo mount -t ext4 -o rw /dev/sda3 mnt
... to enter the system, create a directory called "mnt" and mount the ext4 drive called "/dev/sda3" there in read/write mode (of course, "ext4" and "/dev/sda3" should be changed to the correct definition of your HDD).
Here is where lleb suggested I try "/mnt" instead of simply "mnt", but as my HDD boots fine now I fail to boot it this way and I cannot check whether is one way or the other. (I've a black hole of knowledge in this point, sorry)

5. Except for loosing my Spanish keyboard set it's supposed I then managed the HDD more or less like being local, so I wrote:

Code:
nano /etc/fstab
... and edited fstab like this:
Code:
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>

# / was on /dev/sda3 during installation
UUID=1a7a3977-6977-486a-a915-73915bb0034b /               ext4    errors=remount-ro 0       1

# swap was on /dev/sda2 during installation
UUID=624e103e-20a9-4bda-a7a3-01bafa5b7c06 none            swap    sw              0       0
/dev/sdc1	/media/usb0	auto    rw,user,noauto  0       0
/dev/sdc2       /media/usb  auto    rw,user,noauto  0       0
/dev/sda4	/media/ntfs	ntfs-3g	rw,user,auto	0	0
/dev/sdb1	/media/flash	ntfs-3g	rw,user,auto	0	0
... where the last three lines were added to mount partitions automatically after booting the system or inserting a card. The first is for a SD card slot my comp has but didn't work before, the 2nd is for the NTFS partition that originated the problem, and finally I wrote a line for a SSD my comp came with and never showed up with Linux.
Somehow I lied a little bit: this isn't the first edition of fstab I did. I just tried the simple way by deleting the line that was supposed to have broken it before.

6. I saved nano, restarted and found eveything in its place.


Thanks so much for the help and for the extra info, guys. All the best.

PS: I'm very newbie and still have lots of doubts on many details. Just hope there's no incoherence in the discription of this process but if you find it feel free to point it out. Or suggest options even when I can confirm it worked out for me.

Last edited by LaCaradeculito; 08-16-2013 at 11:54 AM.
 
  


Reply

Tags
fstab, rebooting, recovering, restart


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
I modified fstab to have /home in separate partition (didn't work) Master_CAPS Linux - Newbie 9 10-20-2012 10:42 PM
Dual Boot Issues on modified hp m9200z amadden Fedora - Installation 3 12-19-2009 07:00 PM
Modified the /etc/rc.local file. Now fedora wont boot h8null Linux - General 6 07-27-2009 09:20 AM
Grub cannot boot XP partition that was created/modified by ntfs-3g krisheyrman Linux - General 9 12-25-2008 04:42 AM
Suse won't boot after fstab changes - fstab not editable baking-a-77 Linux - Newbie 10 06-02-2007 11:51 AM


All times are GMT -5. The time now is 01:22 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration