Can I resize "/" partition?
Re: Can I resize "/" partition?
You cannot merge two filesystems without having enough space on one of them already to be able to copy the files over from one to the other.
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?
First you wrote to shrink the root partition which resides on sda, but now you want to merge two partitions on sdb which seems not to be mounted.
the latter task will be easier but first of all to a full backup of all your data on both sdb partitions!
the latter task will be easier but first of all to a full backup of all your data on both sdb partitions!
Re: Can I resize "/" partition?
Yes, I want to increase "/" partition size but I like to merge "sdb" partitions first. I know backup is important always but maybe my files removed on "sdb" partitions?
-
- Posts: 68
- Joined: 2018/12/08 21:46:22
- Location: Italy
Re: Can I resize "/" partition?
Ok First Mount sdb1 and sdb2 a send the output of df -h to see free space in partitionshack3rcon wrote: ↑2019/01/06 11:30:32Can 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.
Re: Can I resize "/" partition?
OK, I mounted them and just copy some files and directories for test:mashiro2004 wrote: ↑2019/01/06 14:55:10Ok First Mount sdb1 and sdb2 a send the output of df -h to see free space in partitionshack3rcon wrote: ↑2019/01/06 11:30:32Can 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.
Code: Select all
# 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/0
tmpfs 101M 0 101M 0% /run/user/1001
/dev/sdb1 50G 52M 47G 1% /mnt/1
/dev/sdb2 50G 52M 47G 1% /mnt/2
-
- Posts: 68
- Joined: 2018/12/08 21:46:22
- Location: Italy
Re: Can I resize "/" partition?
Hi,
but if sdb1 and sdb2 are empty.... You can or remove sdb1 and sdb2 and create only 1 partition sdb1:
unmount sdb1 and sdb2
fdisk /dev/sdb
d (delete)
1 (is the number of partition to delete)
d (delete)
2 (is the number of partition to delete)
w (write changes)
n (create new partition)
p (primary)
1 (number of partition)
enter (first cilinder)
enter (last cilinder)
w
Now you have 1 partition of 100gb
You must now format in ext4
mkfs.ext4 /dev/sdb1
Now you can mount you partition
If are not empy you can:
Copy all file and folders from sdb2 to sdb1. and backup everything to an external drive.
fdisk /dev/sdb
d (delete)
2 (is the number of partition to delete)
w (write changes)
resize2fs /dev/sdb1
but if sdb1 and sdb2 are empty.... You can or remove sdb1 and sdb2 and create only 1 partition sdb1:
unmount sdb1 and sdb2
fdisk /dev/sdb
d (delete)
1 (is the number of partition to delete)
d (delete)
2 (is the number of partition to delete)
w (write changes)
n (create new partition)
p (primary)
1 (number of partition)
enter (first cilinder)
enter (last cilinder)
w
Now you have 1 partition of 100gb
You must now format in ext4
mkfs.ext4 /dev/sdb1
Now you can mount you partition
If are not empy you can:
Copy all file and folders from sdb2 to sdb1. and backup everything to an external drive.
fdisk /dev/sdb
d (delete)
2 (is the number of partition to delete)
w (write changes)
resize2fs /dev/sdb1
Re: Can I resize "/" partition?
I removed "sdb2" but:mashiro2004 wrote: ↑2019/01/07 11:52:21Hi,
but if sdb1 and sdb2 are empty.... You can or remove sdb1 and sdb2 and create only 1 partition sdb1:
unmount sdb1 and sdb2
fdisk /dev/sdb
d (delete)
1 (is the number of partition to delete)
d (delete)
2 (is the number of partition to delete)
w (write changes)
n (create new partition)
p (primary)
enter (first cilinder)
enter (last cilinder)
w
Now you have 1 partition of 100gb
You must now format in ext4
mkfs.ext4 /dev/sdb1
Now you can mount you partition
If are not empy you can:
Copy all file and folders from sdb2 to sdb1. and backup everything to an external drive.
fdisk /dev/sdb
d (delete)
2 (is the number of partition to delete)
w (write changes)
resize2fs /dev/sdb1
Code: Select all
# resize2fs /dev/sdb1
resize2fs 1.42.12 (29-Aug-2014)
Please run 'e2fsck -f /dev/sdb1' first.
Code: Select all
# e2fsck -f /dev/sdb1
e2fsck 1.42.12 (29-Aug-2014)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/sdb1: 15/3276800 files (0.0% non-contiguous), 251703/13107200 blocks
Code: Select all
# resize2fs /dev/sdb1
resize2fs 1.42.12 (29-Aug-2014)
The filesystem is already 13107200 (4k) blocks long. Nothing to do!
-
- Posts: 68
- Joined: 2018/12/08 21:46:22
- Location: Italy
Re: Can I resize "/" partition?
Have you unmounted sdb1? if not unmount it ad re-launch commandshack3rcon wrote: ↑2019/01/07 12:16:25I removed "sdb2" but:mashiro2004 wrote: ↑2019/01/07 11:52:21Hi,
but if sdb1 and sdb2 are empty.... You can or remove sdb1 and sdb2 and create only 1 partition sdb1:
unmount sdb1 and sdb2
fdisk /dev/sdb
d (delete)
1 (is the number of partition to delete)
d (delete)
2 (is the number of partition to delete)
w (write changes)
n (create new partition)
p (primary)
enter (first cilinder)
enter (last cilinder)
w
Now you have 1 partition of 100gb
You must now format in ext4
mkfs.ext4 /dev/sdb1
Now you can mount you partition
If are not empy you can:
Copy all file and folders from sdb2 to sdb1. and backup everything to an external drive.
fdisk /dev/sdb
d (delete)
2 (is the number of partition to delete)
w (write changes)
resize2fs /dev/sdb1And:Code: Select all
# resize2fs /dev/sdb1 resize2fs 1.42.12 (29-Aug-2014) Please run 'e2fsck -f /dev/sdb1' first.
And:Code: Select all
# e2fsck -f /dev/sdb1 e2fsck 1.42.12 (29-Aug-2014) Pass 1: Checking inodes, blocks, and sizes Pass 2: Checking directory structure Pass 3: Checking directory connectivity Pass 4: Checking reference counts Pass 5: Checking group summary information /dev/sdb1: 15/3276800 files (0.0% non-contiguous), 251703/13107200 blocks
Code: Select all
# resize2fs /dev/sdb1 resize2fs 1.42.12 (29-Aug-2014) The filesystem is already 13107200 (4k) blocks long. Nothing to do!
Re: Can I resize "/" partition?
I umounted partitions.mashiro2004 wrote: ↑2019/01/07 12:18:54Have you unmounted sdb1? if not unmount it ad re-launch commandshack3rcon wrote: ↑2019/01/07 12:16:25I removed "sdb2" but:mashiro2004 wrote: ↑2019/01/07 11:52:21Hi,
but if sdb1 and sdb2 are empty.... You can or remove sdb1 and sdb2 and create only 1 partition sdb1:
unmount sdb1 and sdb2
fdisk /dev/sdb
d (delete)
1 (is the number of partition to delete)
d (delete)
2 (is the number of partition to delete)
w (write changes)
n (create new partition)
p (primary)
enter (first cilinder)
enter (last cilinder)
w
Now you have 1 partition of 100gb
You must now format in ext4
mkfs.ext4 /dev/sdb1
Now you can mount you partition
If are not empy you can:
Copy all file and folders from sdb2 to sdb1. and backup everything to an external drive.
fdisk /dev/sdb
d (delete)
2 (is the number of partition to delete)
w (write changes)
resize2fs /dev/sdb1And:Code: Select all
# resize2fs /dev/sdb1 resize2fs 1.42.12 (29-Aug-2014) Please run 'e2fsck -f /dev/sdb1' first.
And:Code: Select all
# e2fsck -f /dev/sdb1 e2fsck 1.42.12 (29-Aug-2014) Pass 1: Checking inodes, blocks, and sizes Pass 2: Checking directory structure Pass 3: Checking directory connectivity Pass 4: Checking reference counts Pass 5: Checking group summary information /dev/sdb1: 15/3276800 files (0.0% non-contiguous), 251703/13107200 blocks
Code: Select all
# resize2fs /dev/sdb1 resize2fs 1.42.12 (29-Aug-2014) The filesystem is already 13107200 (4k) blocks long. Nothing to do!
-
- Posts: 68
- Joined: 2018/12/08 21:46:22
- Location: Italy
Re: Can I resize "/" partition?
try this way:hack3rcon wrote: ↑2019/01/07 12:27:00I umounted partitions.mashiro2004 wrote: ↑2019/01/07 12:18:54Have you unmounted sdb1? if not unmount it ad re-launch commandshack3rcon wrote: ↑2019/01/07 12:16:25
I removed "sdb2" but:And:Code: Select all
# resize2fs /dev/sdb1 resize2fs 1.42.12 (29-Aug-2014) Please run 'e2fsck -f /dev/sdb1' first.
And:Code: Select all
# e2fsck -f /dev/sdb1 e2fsck 1.42.12 (29-Aug-2014) Pass 1: Checking inodes, blocks, and sizes Pass 2: Checking directory structure Pass 3: Checking directory connectivity Pass 4: Checking reference counts Pass 5: Checking group summary information /dev/sdb1: 15/3276800 files (0.0% non-contiguous), 251703/13107200 blocks
Code: Select all
# resize2fs /dev/sdb1 resize2fs 1.42.12 (29-Aug-2014) The filesystem is already 13107200 (4k) blocks long. Nothing to do!
parted
select /dev/sdb
resizepart
1