LinuxQuestions.org
Register a domain and help support LQ
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-24-2011, 03:30 PM   #1
SkM007
LQ Newbie
 
Registered: Jun 2011
Distribution: Oracle, BackTrack
Posts: 28

Rep: Reputation: Disabled
Unhappy fstab file got Deleted


Dear all,

my mistake I deleted fstab file, now after booting I am getting error message saying "you don't have any Linux Partition..."
I know Kernel is not able to mount the partitions coz that file is missing... any idea what to do now; I tried rescue mode but I don't know how to proceed...
forgot to mention that /boot is a standard partition @ /dev/sda1; while /, /home, /var are LV's with address /dev/mapper/vol0-root, /dev/mapper/vol0-home, /dev/mapper/vol0-var...

Plz Help... Thnx in Advance...


SkM...

Last edited by SkM007; 08-24-2011 at 03:34 PM. Reason: missed some information
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 08-24-2011, 03:34 PM   #2
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,592
Blog Entries: 2

Rep: Reputation: 4046Reputation: 4046Reputation: 4046Reputation: 4046Reputation: 4046Reputation: 4046Reputation: 4046Reputation: 4046Reputation: 4046Reputation: 4046Reputation: 4046
Boot from a live CD, mount your Linux partition and create a new fstab.
If you need help with that feel free to ask.
 
Old 08-24-2011, 04:02 PM   #3
SkM007
LQ Newbie
 
Registered: Jun 2011
Distribution: Oracle, BackTrack
Posts: 28

Original Poster
Rep: Reputation: Disabled
Smile

Quote:
Originally Posted by TobiSGD View Post
Boot from a live CD, mount your Linux partition and create a new fstab.
If you need help with that feel free to ask.
Thanx for your help... I do have a Live CD but how m I gonna create fstab file... should i copy fstab file from live cd to /etc/; but how will get my fstab's detail, i mean i use UUID for mounting the partitions...

i think i have to do something else... it will be great if you can elaborate step by step process for fstab creation...

Again... Thnx for taking trouble for me...


SkM...
 
Old 08-24-2011, 04:35 PM   #4
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,592
Blog Entries: 2

Rep: Reputation: 4046Reputation: 4046Reputation: 4046Reputation: 4046Reputation: 4046Reputation: 4046Reputation: 4046Reputation: 4046Reputation: 4046Reputation: 4046Reputation: 4046
1. Boot from your live-CD.
2. Open a terminal.
3. Launch the command
Code:
blkid
This will show you all partitions with their UUIDs and filesystems. Here for example is the output of that command on my laptop:
Code:
tobi@dragon ~ :) % blkid
/dev/sda1: UUID="1f66de30-a6a5-448f-9bad-5b7a3fe22e1c" TYPE="swap" 
/dev/sda2: UUID="2bfe2395-c441-4ec5-89e9-9af815667a83" TYPE="ext4" 
/dev/sda3: UUID="a1632bbd-ddf3-4337-810c-6fab59077ed1" TYPE="ext4" 
/dev/sdb1: UUID="CF4A-303A" TYPE="vfat"
You can see that I have three partitions on drive sda (which is my internal disk) and one partition on an attached SD-card. The SD-card is not needed in the fstab, so we will omit that.
4. Now we will mount your Linux /-partition, in my case it is sda2:
Code:
sudo mount /dev/sda2 /mnt
You now can access all files on that partition under /mnt.
5. Create a new fstab in the mounted partition:
Code:
sudo vim /mnt/etc/fstab
Substitute vim in this command with your favorite text-editor.
6. At first we add some mounts that are necessary for a system to run properly, I just copied the entries from my fstab, you may want to have a look at your live CD's fstab to compare:
Code:
devpts           /dev/pts         devpts      gid=5,mode=620   0   0
proc             /proc            proc        defaults         0   0
tmpfs            /dev/shm         tmpfs       defaults         0   0
7. Now we add the partitions:
Code:
UUID="1f66de30-a6a5-448f-9bad-5b7a3fe22e1c"    swap    swap    defaults    0 0
UUID="2bfe2395-c441-4ec5-89e9-9af815667a83"    /    ext4    defaults    0 1
UUID="a1632bbd-ddf3-4337-810c-6fab59077ed1"    /home    ext4    defaults    0 1
Of course you have to adapt that to your needs. Substitude my UUIDs with the ones shown to you from the blkid-command. Also, if you don't have a separate /home-partition just omit that line.
8. Save that file and close the editor.
9. Unmount the partition:
Code:
sudo umount /mnt
10 Reboot and look if it works.
 
2 members found this post helpful.
Old 08-24-2011, 06:01 PM   #5
SkM007
LQ Newbie
 
Registered: Jun 2011
Distribution: Oracle, BackTrack
Posts: 28

Original Poster
Rep: Reputation: Disabled
Thumbs up

Okay... I got it... I will mount the '/' (in my hdd its /dev/mapper/vol0-root) to a temporary /mnt (of cd) & then i'll create the fstab file...

Thnx a lot sir... u saved my day n my linux too...
 
Old 08-25-2011, 12:07 AM   #6
SkM007
LQ Newbie
 
Registered: Jun 2011
Distribution: Oracle, BackTrack
Posts: 28

Original Poster
Rep: Reputation: Disabled
Smile

Hey Tobi,

Sorry for troubling u again...

I tried it, but I am getting different output than what u have written...

"df -h" doesn't gave any detail about the partitions in my HDD...
"blkid" there was not output
"fdisk -l" output is
/dev/sda1 Linux
/dev/sda2 Linux LVM
/dev/sda3 swap

sda2 is a PV with all LV's inside (/, /home, /var)...

"fdisk -l /dev/sda2" got message saying /dev/sda2 doesn't contain valid partition table...

"mount /dev/mapper/vol0-root /mnt" got message saying root doesn't exist...


Sorry, I can't attach the snapshot, if its required, i'll send...

Thnx...

SkM...
 
Old 08-25-2011, 12:41 AM   #7
andrewthomas
Senior Member
 
Registered: May 2010
Location: Chicago Metro
Distribution: Arch, Gentoo, Slackware
Posts: 1,690

Rep: Reputation: 307Reputation: 307Reputation: 307Reputation: 307
You may have to run the blkid command as root.
 
Old 08-25-2011, 12:45 AM   #8
SkM007
LQ Newbie
 
Registered: Jun 2011
Distribution: Oracle, BackTrack
Posts: 28

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by andrewthomas View Post
You may have to run the blkid command as root.
all those commands were executed as root (using sudo)...
 
Old 08-25-2011, 09:47 AM   #9
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,592
Blog Entries: 2

Rep: Reputation: 4046Reputation: 4046Reputation: 4046Reputation: 4046Reputation: 4046Reputation: 4046Reputation: 4046Reputation: 4046Reputation: 4046Reputation: 4046Reputation: 4046
May be someone other can help here, I know nothing about LVM and how it handles partitions.
 
Old 08-25-2011, 12:08 PM   #10
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 5,591

Rep: Reputation: 496Reputation: 496Reputation: 496Reputation: 496Reputation: 496
Are you able to login single-user or recovery mode?
If you can
Quote:
cd /etc
ls
Look for
/etc/fstab.bak
 
Old 08-27-2011, 11:13 AM   #11
SkM007
LQ Newbie
 
Registered: Jun 2011
Distribution: Oracle, BackTrack
Posts: 28

Original Poster
Rep: Reputation: Disabled
Hey...

sorry for the delay... I tried booting thru a Live CD, after that I was getting error message "System is sleeping forever" something like that... I was not able to get Grub loading screen... that's the reason Single User was not possible... & i didn't tried Rescue Mode... actually I re installed the OS, but I'll try it again... I wanna see how to recover it if fstab is missing...

I'll keep this thread open & let me try once again; I'll update here...

Anyway, Thanks for your Support...
 
Old 08-27-2011, 12:00 PM   #12
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 5,591

Rep: Reputation: 496Reputation: 496Reputation: 496Reputation: 496Reputation: 496
If you're going to try it again try it in virtual box.
 
Old 08-27-2011, 03:54 PM   #13
SkM007
LQ Newbie
 
Registered: Jun 2011
Distribution: Oracle, BackTrack
Posts: 28

Original Poster
Rep: Reputation: Disabled
Smile

okay... let me try it & will update you about my situation...
 
  


Reply

Tags
boot err msg., deleted, fstab


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
How to recover a deleted file using the ext3 file system wdhpr Linux - Newbie 6 01-11-2011 10:04 PM
trying to recover deleted /etc/fstab miteshpant Linux - Newbie 33 09-25-2010 12:15 AM
Deleted log file - how to get back via file descriptor and keep alive? prollocks Linux - General 1 05-29-2009 09:08 AM
Need help to recover Deleted file - (file was saved in doc) Pravab Ubuntu 2 08-17-2008 10:57 AM
Deleted /etc/fstab !! chichibabin Linux - General 6 10-02-2003 07:59 PM


All times are GMT -5. The time now is 02:56 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration