LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.

Notices


Reply
  Search this Thread
Old 04-06-2011, 04:06 AM   #1
cricketlong
Member
 
Registered: Dec 2008
Posts: 52

Rep: Reputation: 15
Is there any way to change the "File System" filed in /etc/fstab every time it boots?


I install my LFS6.3 on a removable disk, it works well now but a defect annoys me, every time it boots my root file system is recognize as /dev/sdb1 on my computer, however, it would not be so lucky to be recognized as /dev/sdb1 meanwhile the "File System" field in /etc/fstab in always /dev/sdb1. So, is there any way to change the "File System" filed in /etc/fstab every time it boots?
Any solution would be appreciated by any people being confused by this defect.
 
Old 04-06-2011, 04:15 AM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
You can use the device ID, the UUID of the filesystem, or the LABEL in /etc/fstab instead of the device node in the first column of fstab. The manpage of fstab should provide the details.

The device nodes can be determined looking at the links in /dev/disk/by-*/ directories.
The UUID can also be determined using "sudo /sbin/blkid <device-node>".

You can also use sudo "/sbin/udevadm info --query all --name <device-node>" to obtain all of the names I mentioned above.

Use an appropriate ID also in grub's menu.lst file as well so that if the device node changes, grub knows which device is root, and where the kernel is, and where the second stage drivers are. This will be needed before /etc/fstab can be read.

Last edited by jschiwal; 04-06-2011 at 04:19 AM.
 
1 members found this post helpful.
Old 04-06-2011, 05:01 AM   #3
cricketlong
Member
 
Registered: Dec 2008
Posts: 52

Original Poster
Rep: Reputation: 15
thanx, jschiwal. The UUID in /etc/fstab was recognized meanwhile the same string(I copied from /etc/fstab to menu.lst) of UUID in menu.lst was recognized as unknown device, here is my menu.lst:

# Begin /boot/grub/menu.lst

# By default boot the first menu entry.
default 0

# Allow 30 seconds before booting the default.
timeout 10

# Use prettier colors.
color green/black light-green/black

# The first entry is for LFS.
title LFS 6.3
root (hd0,0)
kernel /boot/lfskernel-2.6.22.5 ro root=UUID=bc02d4f0-3368-47d9-b862-c55149586d09 rootdelay=8
 
Old 04-07-2011, 04:56 AM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
The form of your kernel line may be wrong. You can use "UUID=<uuid>" in the fstab file, but grub may parse the info in the kernel line differently.

Here is my menu.lst stanza:
Code:
title Desktop -- openSUSE 11.4 - 2.6.37.1-1.2
    root (hd1,0)
    kernel /vmlinuz-2.6.37.1-1.2-desktop root=/dev/disk/by-id/ata-TOSHIBA_MK2049GSY_48CYT01OT-part6 resume=/dev/disk/by-id/ata-WDC_WD3200BEKT-00F3T0_WD-WXC0A8966517-part2 splash=silent quiet showopts vga=0x317
    initrd /initrd-2.6.37.1-1.2-desktop
You could use /dev/disk/by-uuid/... instead if you wish. Or simple use "ls /dev/disk/by-id/*" to see which /by-id/ link to use instead.
 
1 members found this post helpful.
  


Reply



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
Hostname defined in file "network" changes after change to file "hosts" qwkfish Linux - Networking 2 10-14-2009 04:07 PM
changed bios to USB hard drive as #1 option - boots "Missing operating system" Elendrael Linux - Newbie 4 09-12-2007 08:48 PM
Edit "read-only" /etc/fstab from "System Recovery#" (without boot cd?) charlweed Linux - General 1 12-31-2006 05:57 PM
Need ACCESS to change files! Every time I try to change a setting,"Permission Denied" Balarabay1 SUSE / openSUSE 2 03-06-2006 09:54 AM
How do I change "fstab" to Write/Edit Mode? sharathkv Linux - Newbie 4 07-29-2003 07:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 06:15 PM.

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
Open Source Consulting | Domain Registration