Is there any way to change the "File System" filed in /etc/fstab every time it boots?
Linux From ScratchThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.