[SOLVED] Is there the way to extend filesystem with data protection?
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Is there the way to extend filesystem with data protection?
Hi I'm Jeff
I'm managing CentOS 6,7 Server. The server have a Filesystem. It's not a LVM(just normal filesystem of partition).
If I want to extend the Filesystem's size, I have to delete it and make it again. But I want to extend the size without data lose.
Is there anyway to do that ?
* Information
- Server Type : VM (VMWARE EXSI 6.5)
- How to extend Volume : VMWARE DataStore Volume Extend
- Qustion : After I extend volume, How to extend Partition's capacity?
- Server configure
[root@bgsa-tst-t1903 home1]# cat /etc/redhat-release
CentOS Linux release 7.4.1708 (Core)
[root@bgsa-tst-t1903 home1]# fdisk -l
Disk /dev/sda: 107.4 GB, 107374182400 bytes, 209715200 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x0009dc9d
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 41945087 20971520 83 Linux
/dev/sda2 41945088 201326591 79690752 83 Linux
/dev/sda3 201326592 209715199 4194304 82 Linux swap / Solaris
The problem is that the sda3 swap partition immediately follows the 76G sda2 partition. You will need to delete the swap partition, then enlarge the sda2 partition and its xfs filesystem (leaving 4G for the swap partition), and create and format a new swap partition. Note that if your current /etc/fstab references the swap partition by its UUID or label, you should include that UUID or label when formatting the new swap partition. See the mkswap manpage for details.
Well spotted - makes one wish LVM was in the mix ...
Thanks your reply.
If that is not LVM, Is it possible to use xfs_growfs? I have another server and have same situation. That server has ext4 filesystem and It's not a LVM.
I just want to resize my filesystem(not LVM) without delete and recreate.
The xfs_growfs is not dependent on LVM - the problem is as stated in post #3; swap is in the way. You can only grow the filesystem if the partition is larger than the filesystem. However the partition must be contiguous space, not broken over segments.
resize2fs will similarly enlarge ext4 filesystems. See the manpage for both commands.
The xfs_growfs is not dependent on LVM - the problem is as stated in post #3; swap is in the way. You can only grow the filesystem if the partition is larger than the filesystem. However the partition must be contiguous space, not broken over segments.
resize2fs will similarly enlarge ext4 filesystems. See the manpage for both commands.
Thanks. I solved it. As you said, I deleted my swap partition and /dev/sda2. After then, I made a new partition(completed resizing).
Delete -> Make New Partition -> reboot -> resize2fs
I just worried about data lose but It didn't happen.
Good..
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.