I am using an SSD where I have 3 partitions:
$ lsblk /dev/sda
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 111.8G 0 disk
├─sda1 8:1 0 2M 0 part
├─sda2 8:2 0 108G 0 part /
└─sda3 8:3 0 3.8G 0 part /mnt
The /dev/sda2
and /dev/sda3
was formatted as XFS.
I don't need the /dev/sda3
any more, I don't have any data there, and I want to merge it with /dev/sda2. It's not a big problem if I have to unallocate /dev/sda2
. But I have important data and the overall OS installed on /dev/sda2
.
Is there a way to merge /dev/sda3 with /dev/sda2 in a way that the data on /dev/sda2
remains intact?
Edit:
Before asking I have tried xfs_growfs this way:
# xfs_growfs /dev/sda2
meta-data=/dev/sda2 isize=512 agcount=4, agsize=7077888 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=1, sparse=1, rmapbt=0
= reflink=0
data = bsize=4096 blocks=28311552, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0, ftype=1
log =internal log bsize=4096 blocks=13824, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
It doesn't do anything. I have also tried deleting partition 3, and then running xfs_growfs
with both /
and /dev/sda2
. I rebooted, and saw that the free space is free, and /dev/sda2
is 108 GB as always.
I am not using LVM.
Details:
xfs_info -V
xfs_info version 5.7.0
OS:
$ cat /etc/os-release | head -n1
NAME="Arch Linux"
Kernel:
$ cat /proc/version
Linux version 5.8.5-xanmod1-1-xanmod (makepkg@archlinux) (gcc (GCC) 10.2.0, GNU ld (GNU Binutils) 2.35) #1 SMP PREEMPT Wed, 02 Sep 2020 20:22:18 +0000
The output from
– 15 Volts Sep 06 '20 at 17:39lsblk -o name,fstype,size,fssize,mountpoint,label,model,vendor
is here: https://pastebin.com/EPQBwfZm ... Now if I doxfs_growfs /
and reboot, nothing happens.dd if=/dev/urandom of=/test_file bs=10M count=1000 status=progress
dd failed. I learnt the xfs partition, even though has more space now, can't be utilized unlessxfs_growfs
is run... Then I ran that on/
and the whole system has more space now!! Thanks a lot! – 15 Volts Sep 06 '20 at 20:38