Quick question: Can I resize a filesystem without resizing the partition in advance? The question aims at growing, but information on shrinking might be useful for future reference too.
Here's the scenario:
- SLES VM running on vSphere
- Extend virtual disk to bigger size
- The disk has a single partition but no LVM
- Log into SLES VM and run the following commands:
- Perform SCSI rescan:
echo '1' > /sys/class/scsi_disk/<foobar>/device/rescan
- Verify extended disk:
fdisk -l
- Resize filesystem:
resize2fs /dev/foo
- Perform SCSI rescan:
- Result: Filesystem successfully resized
A colleague told me about this and did it, but I was sure that it have to resize the partition with fdisk
or similar in advance as pointed out here.