Understand Partitions
Understand Partitions
Hi, I trying to understand which partition I have on the hard disk when I install CentOS7. So I installed CentOS 7 on a VM and I run lsblk command.
What is sda2?
sda 8:0 0 60G 0 disk
├─sda1 8:1 0 200M 0 part /boot/efi
├─sda2 8:2 0 1G 0 part /boot
└─sda3 8:3 0 58.8G 0 part
├─centos-root 253:0 0 38.2G 0 lvm /
├─centos-swap 253:1 0 2G 0 lvm [SWAP]
└─centos-home 253:2 0 18.6G 0 lvm /home
I know that
sda1 its the efi partition that contain the boot loader, kernel images....
sda3 is managed by LVM and contain OS-Root partition, swap partition for the RAM and home partition for the users.
please correct me if I am wrong
What is sda2?
sda 8:0 0 60G 0 disk
├─sda1 8:1 0 200M 0 part /boot/efi
├─sda2 8:2 0 1G 0 part /boot
└─sda3 8:3 0 58.8G 0 part
├─centos-root 253:0 0 38.2G 0 lvm /
├─centos-swap 253:1 0 2G 0 lvm [SWAP]
└─centos-home 253:2 0 18.6G 0 lvm /home
I know that
sda1 its the efi partition that contain the boot loader, kernel images....
sda3 is managed by LVM and contain OS-Root partition, swap partition for the RAM and home partition for the users.
please correct me if I am wrong
Re: Understand Partitions
OK I'll *attempt* to answer this question though I'm *probably* WRONG!! ...Especially since you are running CentOS 7 as a VM which I have not done.shahar91 wrote:Hi, I trying to understand which partition I have on the hard disk when I install CentOS7. So I installed CentOS 7 on a VM and I run lsblk command.
What is sda2?
sda 8:0 0 60G 0 disk
├─sda1 8:1 0 200M 0 part /boot/efi
├─sda2 8:2 0 1G 0 part /boot
└─sda3 8:3 0 58.8G 0 part
├─centos-root 253:0 0 38.2G 0 lvm /
├─centos-swap 253:1 0 2G 0 lvm [SWAP]
└─centos-home 253:2 0 18.6G 0 lvm /home
I know that
sda1 its the efi partition that contain the boot loader, kernel images....
sda3 is managed by LVM and contain OS-Root partition, swap partition for the RAM and home partition for the users.
please correct me if I am wrong
A little background is in order: I run CentOS 7.4 as my primary OS, and I have set up it up using a Classical Partitioning Scheme.
Onward!! The /boot/efi partition is only necessary IF you are using a machine that has UEFI, and has no classical BIOS to refer to. UEFI, as I understand it -- which could be WRONG -- is basically a small FAT32 partition that replaces the MBR on a standard HDD, and this is the substitute for the BIOS. The /boot partition OTOH -- sda2 in your case -- is the the partition that holds GRUB2 that boots the OS, the sda2 /boot partition can be formated in ext4, xfc, etc. .... whereas the /boot/efi partition *must* be FAT32.
Now comes the interesting question: Given that you have installed CentOS 7 as a VM , which can not access the BIOS since it is installed in volatile RAM I'm not sure you need the /boot/efi partition, but you DO need the /boot partition because that loads the OS. I am sure someone will correct if I am WRONG. Me?? As my primary OS with a MB that supports both UEFI and Legacy (Classical) BIOS, I have set it up to use a Classical MBR BIOS, as I have had nothing but bad luck trying to use UEFI, hence I have set it up as such:
/boot
/
/usr
/home
/tmp
/var
/vm4
/backup
SWAP
Re: Understand Partitions
You've obviously installed on a UEFI capable VM as you have a separate /boot/efi. You also have a separate /boot partition - your sda2 - which contains the necessary files required to boot your system to the point where it becomes useful. Your /dev/sda3 is an LVM Physical Volume (PV) and that PV belongs to an LVM Volume Group called 'centos'. In that centos VG, you have 3 LVM Logical Volumes - LVs - called 'root', 'swap' and 'home'.sda 8:0 0 60G 0 disk
├─sda1 8:1 0 200M 0 part /boot/efi
├─sda2 8:2 0 1G 0 part /boot
└─sda3 8:3 0 58.8G 0 part
├─centos-root 253:0 0 38.2G 0 lvm /
├─centos-swap 253:1 0 2G 0 lvm [SWAP]
└─centos-home 253:2 0 18.6G 0 lvm /home
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Re: Understand Partitions
Thanks for the answers.
I know that I need EFI partition because I installed this machine on UEFI but I thought that GRUB2 located in EFI partition. Wikipedia site confused me.
I know that I need EFI partition because I installed this machine on UEFI but I thought that GRUB2 located in EFI partition. Wikipedia site confused me.
Re: Understand Partitions
One can always ask "What is in there?"
The sda1 is mounted on /boot/efi, so lets list all files in there:
The sda2 is mounted on /boot, so we could just do find, but we don't want the content of /boot/efi in the list:
The sda1 is mounted on /boot/efi, so lets list all files in there:
Code: Select all
sudo find /boot/efi
Code: Select all
sudo find /boot -path /boot/efi -prune -o -print
Re: Understand Partitions
-xdev might be easier to type
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Re: Understand Partitions
Are they not separate partitions? sda1, sda2 and sda3?jlehtone wrote:One can always ask "What is in there?"
The sda1 is mounted on /boot/efi, so lets list all files in there:The sda2 is mounted on /boot, so we could just do find, but we don't want the content of /boot/efi in the list:Code: Select all
sudo find /boot/efi
Code: Select all
sudo find /boot -path /boot/efi -prune -o -print
Re: Understand Partitions
Yes, the disk "sda" has three partitions: sda1, sda2, sda3.
Re: Understand Partitions
/boot and /boot/efi make me confused, those two start with /boot. How?jlehtone wrote:Yes, the disk "sda" has three partitions: sda1, sda2, sda3.
Re: Understand Partitions
You are confusing partitions and mount points. A partition is a chuck of space somewhere. Most commonly it is part of some spinning rust, but could be space on another system, in memory or a map to space elsewhere. It doesn't matter, provided the kernel can load the appropriate driver the driver handles all the nasty physical stuff.
A directory is an index file telling the filesystem where to find files. When you mount a partition the kernel hijacks its internal understanding of the directory and stores information allowing it to invoke the appropriate driver. The top level directory of the partition then appears as if it were the original directory.
In the present case:
A directory is an index file telling the filesystem where to find files. When you mount a partition the kernel hijacks its internal understanding of the directory and stores information allowing it to invoke the appropriate driver. The top level directory of the partition then appears as if it were the original directory.
In the present case:
- /boot is a directory on the root partition which is copied into Linux's internal cache.
- sda2 is a partition somewhere on the first disk.
- # mount /dev/sda2 /boot changes the internal version to be pointers that the kernel uses to find sda2
- /boot now transparently vectors you to the top level directory of sda2.
- Within sda2's top level directory there is a directory called efi. Due to the mount above it appears to be at /boot/efi
- We have already found the directory /boot/efi which is copied into Linux's internal cache.
- sda1 is a partition somewhere on the first disk.
- # mount /dev/sda1 /boot/efi changes the internal version to be pointers that the kernel uses to find sda1
- /boot/efi now transparently vectors you to the top level directory of sda1.
- Within sda1's top level directory there is a directory called EFI (at least on my machine). Due to the mount above it appears to be at /boot/efi/EFI