Linux from Scratch - Repeated Setup Steps
During the Linux From Scratch process, there may be times when the build environment (computer, VM, chroot, whatever) must be restarted. If so, there are a few steps from the setup phase that have to be re-initialized. This post maps out those steps.
To set the #LFS variable, I ran the following command: *
To check that the variable set correctly, just print it out using echo (if successful, the path that was specified should print out).
After setting the $LFS variable, I could finally mount my LFS drive/partition to that location. First, I ensured that the directory existed by running:
mkdir -pv $LFS
Note: In this command, the -v again means verbose, so a message will be printed for each directory created. The -p flag is for –parents, and will instruct "mkdir" to also make parent directories, as needed. So, if
/mnt/ does not already exist, will be created along with
After creating the directories, I mounted them with the command:
sudo mount -v -t ext4 /dev/sdb
If multiple partitions are being used for the LFS build (such as a separate
/home partition), they should also be mounted at this time.
After mounting my partition, the LFS book recommended that I check that the partition was not mounted with restrictive permissions. To do this, I ran the
mount command again, but this time without any parameters. From the output, I was able to see and confirm that the partition was not mounted with restrictive permissions, such as
nodev. If either of these options are set, the partition should be remounted.
Lastly, if a swap partition is being used, do not forget to enable it using
swapon -v /dev/xxx (with xxx the name of the swap partition)