Can I resize "/" partition?
Can I resize "/" partition?
Hello.
Is it possible to resize the Linux partition without losing data?
Thank you.
Is it possible to resize the Linux partition without losing data?
Thank you.
Re: Can I resize "/" partition?
Yes. This will depend upon what partitioning scheme you used when first installing. It's probably easiest with LVM. If you're not familiar with disk resizing, the safest way is to boot off a gparted disk and use its GUI interface to do it.
https://gparted.org/
https://gparted.org/
New users should check the FAQ and Read Me First pages
Re: Can I resize "/" partition?
It's possible to _increase_ it's size online while it's mounted and running. To shrink it requires that it be done offline via a separate boot disk and can only be done if it's using ext2/3 or ext4. The xfs filesystem cannot be shrunk at all.
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: Can I resize "/" partition?
Thank you but I want to do it by command line. I want to merge "sdb1" and "sdb2" :scottro wrote: ↑2019/01/05 11:24:03Yes. This will depend upon what partitioning scheme you used when first installing. It's probably easiest with LVM. If you're not familiar with disk resizing, the safest way is to boot off a gparted disk and use its GUI interface to do it.
https://gparted.org/
Code: Select all
# fdisk -l
Disk /dev/sdb: 100 GiB, 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
Disklabel type: gpt
Disk identifier: E58FA36C-9B1D-4EDA-8C7A-4BA352780D49
Device Start End Sectors Size Type
/dev/sdb1 2048 104859647 104857600 50G Linux filesystem
/dev/sdb2 104859648 209715166 104855519 50G Linux filesystem
-
- Posts: 68
- Joined: 2018/12/08 21:46:22
- Location: Italy
Re: Can I resize "/" partition?
Hi, can you post also result of: lsblk and df -h
Re: Can I resize "/" partition?
Hi.
Sure:
Code: Select all
# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 35G 0 disk
├─sda1 8:1 0 33.5G 0 part /
├─sda2 8:2 0 1K 0 part
└─sda5 8:5 0 1.5G 0 part [SWAP]
sdb 8:16 0 100G 0 disk
├─sdb1 8:17 0 50G 0 part
└─sdb2 8:18 0 50G 0 part
# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 33G 1009M 31G 4% /
udev 10M 0 10M 0% /dev
tmpfs 201M 3.0M 198M 2% /run
tmpfs 501M 0 501M 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 501M 0 501M 0% /sys/fs/cgroup
tmpfs 101M 0 101M 0% /run/user/1001
-
- Posts: 68
- Joined: 2018/12/08 21:46:22
- Location: Italy
Re: Can I resize "/" partition?
On sdb2 have you data?
The Better way Is destroy sdb2 and enlarging sdb1 on free space.
The Better way Is destroy sdb2 and enlarging sdb1 on free space.
Re: Can I resize "/" partition?
Without destroy, is it impossible?mashiro2004 wrote: ↑2019/01/06 09:55:35On sdb2 have you data?
The Better way Is destroy sdb2 and enlarging sdb1 on free space.
-
- Posts: 68
- Joined: 2018/12/08 21:46:22
- Location: Italy
Re: Can I resize "/" partition?
It Is possibile to extend partition in unallocated space only. If you have enought space you Can shrink sdb2, extend sdb1 move data fronte sdb2 in sdb1 destroy sdb2 and extend sdb1. With lvm volume is more flexible, because you Can add phisical disk to volume move data and the remove....
Re: Can I resize "/" partition?
Can you write properly commands here?mashiro2004 wrote: ↑2019/01/06 10:44:13It Is possibile to extend partition in unallocated space only. If you have enought space you Can shrink sdb2, extend sdb1 move data fronte sdb2 in sdb1 destroy sdb2 and extend sdb1. With lvm volume is more flexible, because you Can add phisical disk to volume move data and the remove....
Thank you.