1. LFS‎ > ‎

2. Partitioning

created : 2010-01-27   updated : 2010-01-27
 
To build LFS, a new partition or a new harddisk is needed.  Since I am using VirtualBox,  it is simple to add a new virtual harddisk in my system.
 
Check the partition table using fdisk :
 
fdisk -l
 
Result in my virtual computer :
 
Disk /dev/sdb: 7516 MB, 7516192768 bytes
255 heads, 63 sectors/track, 913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000
Disk /dev/sdb doesn't contain a valid partition table
Disk /dev/sda: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0005fe07
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1         993     7976241   83  Linux
/dev/sda2             994        1044      409657+   5  Extended
/dev/sda5             994        1044      409626   82  Linux swap / Solaris
 
It shown that "/dev/sdb doesn't contain a valid partition table".  So that would be my candidate for installing LFS.
 
First I created a partition for LFS using fidsk :
fdisk /dev/sdb
 
I used the following hotkey sequence.
 
m   for help
n   to add a new partition
P   to make it a primary partition
1   to make it the first partition
<ENTER>  accepting default for the first cylinder
<ENTER>  accepting default for the last cylinder
w   write change to disk and exit fdisk
 
Then I used fdisk to list the partition table again :
fdisk -l
 
This time /dev/sdb1 was available.
 
   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1         913     7333641   83  Linux
 
To create an ext3 file system on the LFS partition, run the following:
 
time mke2fs -jv /dev/sdb1
 
result :
 
This filesystem will be automatically checked every 38 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
 
real    0m13.565s
user    0m0.012s
sys     0m2.476s
 
check the feature on the LFS partition :
debugfs -R feature /dev/sdb1
 
result :
debugfs 1.41.9 (22-Aug-2009)
Filesystem features: has_journal ext_attr resize_inode dir_index filetype sparse_super large_file
 
Noted : If the output contains features other than has_journal, ext_attr, resize_inode, dir_index, filetype, sparse_super, large_file or needs_recovery, then your host system may have
custom enhancements. In that case, to avoid later problems, you should compile the stock E2fsprogs package and use the resulting binaries to re-create the filesystem on your LFS partition.
Mounting the LFS partition :
 
Choose a mount point and assign it to the LFS environment variable by running:
export LFS=/mnt/lfs

 

Next, create the mount point and mount the LFS file system by running:
mkdir -pv $LFS
mount -v -t ext3 /dev/sdb1 $LFS
 
 
The End.
 
 
Comments