On 06/26/2014 06:37 AM, Pierre Labastie wrote:
Le 26/06/2014 11:23, Marcos Menendez a écrit :
Hello,

I would like your advice in knowing which is the right partition to define in the /etc/fstab file.

I ask it because when I´m in chroot I have this:

# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda1       9.2G  4.1G  4.6G  48% /
devtmpfs        486M  152K  485M   1% /dev
tmpfs           486M  152K  485M   1% /dev/shm
devtmpfs        486M  152K  485M   1% /dev
tmpfs           499M   12K  499M   1% /run

and when I logout to the host I have:

# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda1       9.7G  1.1G  8.1G  12% /
tmpfs           499M     0  499M   0% /dev/shm
/dev/sda2       9.2G  4.1G  4.6G  48% /mnt/lfs
tmpfs           499M   12K  499M   1% /mnt/lfs/run


As you see, in chroot the LFS partition corresponds to /dev/sda1 but in the host it corresponds to /dev/sda2.

So, what should be the right one to choose?


Marcos

I'd guess the right one is /dev/sda2, and suspect a bug in "df" when in chroot. You should know what you typed when you mounted /mnt/lfs: the right partition is the one you gave to this command.

Actually, on my machine, in chroot I have (/mnt/lfs is mounted on an LVM volume):
# df -h
df: « /mnt/virtualMachines »: Aucun fichier ou dossier de ce type
df: « /sys/fs/cgroup/systemd »: Aucun fichier ou dossier de ce type
df: « /run/user/1000/gvfs »: Aucun fichier ou dossier de ce type
Sys. de fichiers   Taille Utilisé Dispo Uti% Monté sur
rootfs               9,8G    3,1G  6,2G  34% /
udev                  10M       0   10M   0% /dev
/dev/sdb3            9,8G    3,1G  6,2G  34% /
/dev/sdb1            9,8G    3,1G  6,2G  34% /boot
tmpfs                7,9G       0  7,9G   0% /run/shm
/dev/mapper/vg-lfs   9,8G    3,1G  6,2G  34% /
udev                  10M       0   10M   0% /dev
shm                  7,9G       0  7,9G   0% /run/shm

Hmm, two different volumes for "/", and all with the same size (actually, the size of /dev/mapper/vg-lfs)
----------------------
While the normal system gives:
$ df -h
Sys. de fichiers       Taille Utilisé Dispo Uti% Monté sur
/dev/sdb3                154G     21G  125G  15% /
udev                      10M       0   10M   0% /dev
tmpfs                    1,6G    920K  1,6G   1% /run
tmpfs                    5,0M       0  5,0M   0% /run/lock
tmpfs                    9,1G     92K  9,1G   1% /run/shm
/dev/sdb1                180M     45M  127M  27% /boot
/dev/mapper/vg-home       30G     22G  6,8G  76% /home
/dev/mapper/vg-virtual   296G    169G  112G  61% /mnt/virtualMachines
/dev/sda2                464G     83G  381G  18% /mnt/windows
none                     4,0K       0  4,0K   0% /sys/fs/cgroup
/dev/mapper/vg-lfs       9,8G    3,1G  6,2G  34% /mnt/lfs

-----------------
"cat /proc/mounts" gives roughly the same information, but the output is harder to sort out. Here is the (trimmed) output when in chroot:
# cat /proc/mounts
rootfs / rootfs rw 0 0
[...]
/dev/disk/by-uuid/54f6e789-5bfb-4a56-aee9-da873ece10f6 / ext4 rw,relatime,data=ordered 0 0
[...]
/dev/sdb1 /boot ext3 rw,relatime,data=ordered 0 0
/dev/mapper/vg-home /home ext4 rw,relatime,data=ordered 0 0
/dev/mapper/vg-virtual /mnt/virtualMachines ext4 rw,relatime,data=ordered 0 0 /dev/sda2 /mnt/windows fuseblk rw,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096 0 0
[...]
/dev/mapper/vg-lfs / ext4 rw,relatime,data=ordered 0 0
[...]
-----------------------
to be complete:
# blkid /dev/sdb3
/dev/sdb3: UUID="54f6e789-5bfb-4a56-aee9-da873ece10f6" TYPE="ext4"

So again, there are 2 different volumes for "/"...

Pierre

Just a friendly reminder.

The purpose of "df" is to show the available space in *mounted* filesystems. The command <df -h>, here df has no argument, show the space available on all mounted *filesystems.* Its output is filesystems and not devices.

I think what you're looking for is a utility to list the partition table of your machine. <parted -l> will give you that list. I suggest parted and not fdisk because I don't think fdisk recognizes gpt partitions yet. If you know that your partition table is *not* gpt, fdisk will work fine.

Using df to help write /etc/fstab is a good idea. But if you want all of your partitions in it, df won't give you the complete picture.

Dan

--
http://lists.linuxfromscratch.org/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to