Kinh Nghiệm Du Lịch Hà Nội Cần Thiết Cho Du Khách.

General support questions
Post Reply
User avatar
jlehtone
Posts: 4530
Joined: 2007/12/11 08:17:33
Location: Finland

Re: How To Installing Partition Centos 7 effectively

Post by jlehtone » 2019/03/10 10:09:36

Code: Select all

Filesystem              Size Used Avail Use% Mounted on
/dev/mapper/centos-root  50G 2.5G   48G   5% /
/dev/sda1              1014M 202M  813M  20% /boot
/dev/mapper/centos-home 1.4T 434M  1.4T   1% /home
How much web files do you expect to accumulate?

Other informative commands:

Code: Select all

lsblk
df -h /var/www
findmnt
Option A:
1. Move content of /var/www from /dev/mapper/centos-root into /dev/mapper/centos-home
2. Bind-mount the new location back to /var/www

Option B:
1. Shrink /dev/mapper/centos-home (Note: there is no "shrink" for XFS)
2. Create LV for www
3. Move content of /var/www from /dev/mapper/centos-root into new LV
4. Mount the new LV to /var/www

Option C:
1. Move content of /var/www to X
2. Configure httpd to use X


Selinux labels are "relatively easy" to fix.

emailkprasad
Posts: 12
Joined: 2019/03/14 14:25:17

Re: How To Installing Partition Centos 7 effectively

Post by emailkprasad » 2019/03/14 16:41:56

Option D:

1.) Move /home directory contents temporarily to some other path in /. for ex: /var/home
2.) umount /home
3.) lvremove the /dev/mapper/centos-home
4.) lvextend /dev/mapper/centos-root and xfs_grow (or resize2fs) /dev/mapper/centos-root
5.) Copy the /var/home directory to / (and verify user permissions haven't changed due to mv /cp )

This way there will be only one LV with maximum space.

ron7000
Posts: 162
Joined: 2019/01/15 20:00:28

Re: How To Installing Partition Centos 7 effectively

Post by ron7000 » 2019/03/16 18:50:14

How To Installing Partition Centos 7 effectively
my recommendation, is to do custom partition during the install; that way you know what you are getting and you maybe can head off various shortcomings in the near/distant future....

keeping it real simple, with an EFI system, using a single disk to have the operating system installed on it the output from mount could look like

Code: Select all

/dev/sda3 on / type xfs
/dev/sda2 on /boot type xfs
/dev/sda1 on /boot/efi type vfat
that is all you need, and a *df -h* shows

Code: Select all

Filesystem      Size  Used Avail Use% Mounted on
/dev/sda3       475G   28G  448G   6% /
devtmpfs        3.9G     0  3.9G   0% /dev
tmpfs           3.9G   24M  3.9G   1% /dev/shm
tmpfs           3.9G  9.7M  3.9G   1% /run
tmpfs           3.9G     0  3.9G   0% /sys/fs/cgroup
/dev/sda2       947M  217M  731M  23% /boot
/dev/sda1        95M   12M   84M  12% /boot/efi
tmpfs           794M  4.0K  794M   1% /run/user/42
tmpfs           794M   24K  794M   1% /run/user/0
Know that tmpfs is mounts to RAM (memory) and not your hard disk, the tmpfs sizes will vary.

This is centos-7.6 on a 500gb ssd, I made 4 partitions total one was SWAP at 1gb which is /dev/sda4 not shown above. That way everything is under the root folder system using up the entire disk, if you run on off space then at that point you need a larger disk and it won't be because of *partition sizes you either guessed at or let the automatic partitioning choose for you[/i]. I hate when it gives you / at 25% of the disk and the /home partition is 75% of the disk that really nukes you later on when you have lots of software and other things installed... which is never under the /home partition

Post Reply