New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
CentOS8 - Resize Partition after install
I installed Centoss8 on a vps. Enabled FDE/ Luks during install. I did not do custom partitioning. So, now, I am having /home with full size of the disk.
I would like to:
a. resize /home to around 10GB
b. Create /data and allocate it remaining space (around 450GB)
I am not familiar on how to achieve the same. Id prefer not to re-install (if possible)
Any suggestions? TIA
Comments
Parted is your friend.
https://www.tecmint.com/parted-command-to-create-resize-rescue-linux-disk-partitions/
Another easy option would be using mounting gparted
Umm... can you share some more details pls? Thank you
This is for our system :
https://my.nexusbytes.com/knowledgebase/29/RepartitionorResizing-your-VM-Disk-Space.html
If your current provider allows you to mount your own iso, https://gparted.org/livecd.php , you can do the same!
Awesome. currently, i do not have ability to mount an ISO... so, let me see what I can do. Thank you
For some reason, this is just showing me the boot and the whole partition.. I cannot seem to locate /, /home etc from parted... what could I be missing here? TIA
A suggestion (esp. for the long run):
Rather than have a huge partition, try to use LVM instead. It will allow you to dynamically size/resize use your resources better without having to go through the pain of repartitioning (again).
Do it now since you only have at most 10GB of data from your home. Boot into rescue mode, copy over the 10GB of data into a temp location, create a single huge partition with the space and give it to LVM and then chunk it into whatever pieces you need whenever you need it.
If you're upto it (I don't know about ZFS support in CentOS), use ZFS instead as it'll give you all the benefits without much pain. (relatively steepest learning curve here but well worth it in the long run). Needs good memory to work nicely (so not suggested unless you have at least 1GB+ surplus RAM for various ZFS overhead).
So there you go:
P.S: Separately, in your case, you can also do this live without rescue mode. Unmount home, shrink fs to minimal size, repartition (keeping starting sector the same for the home mount and size > your used space and taking the rest for data mount), extend home fs, format data fs, remount home, enjoy.
Looks like its already LVM... having 3 partitions.. root/ swap/ home... so, I want to shrink /home and make a new one called /data with remaining space...
Any suggestions on how to achieve this?
Oh that makes your life easy.
(rough steps, RTFM for the fine print it should be pretty painless to get the numbers you want). It is loss less - so you can experiment safely.
Hope this helps.
Awesome. will try this.. Just wondering.. do I do this on the live system? or should I mount this somewhere? curreently, its a fresh install server, so theres no data.
You can do this on the live system (as long as you are root and you can unmount /home, i.e no user mount/files active like via sudo). It is only because you are shrinking that you need the unmount. A typical LVM expand is online and disruption free.
Awesome. Ill post my findings in sometime. Thank you
I stick to ext4 for my main partitions, instead of the default xfs, in order to shrink as well as expand. I presume that you can shrink zfs. (?) I've never had enough 'surplus' RAM to try using it.
[tmp=ext2 as well as /backup]
Well I didnt realize it was xfa. Decided to do anfresh install with ext4..
Any reason to select xfs vs ext4?
This is a loaded question. ZFS the fs on top of a (Z)Pool (think LVM here) is autosized (dynamic sizing possible along with quota/reservations).
At the lowest level, the Zpool itself cannot shrink - it can only grow.
Roughly, equating PV/VG <-> Zpool, the Zpool cannot shrink (unlike a PV or a VG which can).
At the LV <-> ZFS level (think ZFS instead of EXT2/3/4/XFS here) absolutely the norm and dynamic even. So you can have a huge PV/VG equivalent (that is fixed) Zpool and within it, your FSs which can grow/shrink etc. as required with all the benefits of ZFS (snapshots, quotas, etc.)
This is the hard part. The larger the underlying device (i.e. space), the more RAM ZFS needs (or is advisable) for decent performance. But were talking ~2-5GB of RAM for <10TB of storage (for decent performance) so it's not gargantuan.
What's wrong with not partitioned disk ? it's not like /home will take all of it. AFAIK it will share the space with /, I don't see any advantages of partitioning disk unless you plan to reinstall the server, and don't want /home get deleted.
Huh? How does/home or any particular partition share space with /?
I'd love to learn more... please.. this is new for me.
When installed linux, if you opted to use single partition, / will use all the space, including /home, /data2 or any folder in /
I failed to see, why would you want to allocate partition the disk to 10GB, and mount the partition to /home.
Well I wanted to keep data in a separate partition... so when I saw the default partition system, it had just / root with like 20gb, some swap and remaining allotted to /home.. so I wasn't aware that space will be shared with / root
Keeping data on another partition doesn't really make sense, unless of course when you are on home pc using windows where you have to reinstalling OS from scratch every once in a while.
Well, since you are already on freh server. I suggest you to just use 1 big partition. I don't see any downside to that. it's equivalent on Windows using only 1 drive (c:) without any other drive. All of your data will shared the same amount of free space with the main system.
There are a number of advantages to splitting into partitions.
... and no doubt a few more of that don't spring immediately to mind.
Of course, those of us old enough to remember prolific use of Windoze on rust, will likely know how shitty its' filesystems are/were at fragmentation and its effect on performance, in particular. It's that OS that has made too many lazy sysadmins, IMHO. When I first encountered *nix, you had to get a calculator out and manually work out how to chop up a disc into partitions, using CHS.
Once, I'd seen the light, however, I began to partition up 'doze boxes too, splitting the OS from user data.
I prefer to have my data stashed in a separate folder.. windows or linux. Just makes it easy to remember the same path across all my idling servers... yes, I dont install os every day...
The biggest reason (from the old days) is:
If your root partition is nice and small and rarely written to, then when your system crashes your root partition (containing fsck and similar) is likely to be intact. That will ensure you can recover the crashed system without having to boot to external media. Similar situation in the event that something (like syslog) freaks out and fills up your disk... you'll still have a good root fs that is unaffected and will let you recover from the problem.
^ I did say there were other good reasons.
The eejits that post on the CWP forum saying their (root) disc is full, is one example.