MichaelBalack
asked on
How to add this extra disk space to an existing ext3 partition in SuSE OS?
This is a SuSE 11 SP4 VMware virtual machine. Initially 1 virtual hard disk was allocated with 140 GB. However, the disk space is getting less, and we increase this virtual hard disk size with additional 50 GB. The SuSE disk layout is as follows,
# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 38G 35G 2.1G 95% /
udev 7.8G 100K 7.8G 1% /dev
tmpfs 7.8G 76K 7.8G 1% /dev/shm
/dev/sda4 50G 43G 4.4G 91% /opt/omd/sites/ssp/var
tmpfs 7.8G 29M 7.8G 1% /opt/omd/sites/ssp/tmp
/dev/sda3 40G 34G 4.3G 89% /opt/repo
The partition that we intend to increase is /dev/sda2. On SuSE, we run "echo '- - -' > /sys/class/scsi_host/hostX /rescan"; replace X with 0, 1, and 2.
Now, if you type "fdisk -l", you manage to see additional 50 GB is added (as unpatitioned)
# fdisk -l
Disk /dev/sda: 204.0 GB, 204010946560 bytes
255 heads, 63 sectors/track, 24802 cylinders, total 398458880 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 identifier: 0x0007dea3
Device Boot Start End Blocks Id System
/dev/sda1 2048 4208639 2103296 82 Linux swap / Solaris
/dev/sda2 * 4208640 83886079 39838720 83 Linux
/dev/sda3 83886080 167772159 41943040 83 Linux
/dev/sda4 167772160 272629759 52428800 83 Linux
BTW, how to add this new 50 GB disk space into /dev/sda2? I heard that we can use resize2fs, fsck, and so on. Please share on how to add this extra disk space without affecting the data in /dev/sda2.
Thanks in advance.
# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 38G 35G 2.1G 95% /
udev 7.8G 100K 7.8G 1% /dev
tmpfs 7.8G 76K 7.8G 1% /dev/shm
/dev/sda4 50G 43G 4.4G 91% /opt/omd/sites/ssp/var
tmpfs 7.8G 29M 7.8G 1% /opt/omd/sites/ssp/tmp
/dev/sda3 40G 34G 4.3G 89% /opt/repo
The partition that we intend to increase is /dev/sda2. On SuSE, we run "echo '- - -' > /sys/class/scsi_host/hostX
Now, if you type "fdisk -l", you manage to see additional 50 GB is added (as unpatitioned)
# fdisk -l
Disk /dev/sda: 204.0 GB, 204010946560 bytes
255 heads, 63 sectors/track, 24802 cylinders, total 398458880 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 identifier: 0x0007dea3
Device Boot Start End Blocks Id System
/dev/sda1 2048 4208639 2103296 82 Linux swap / Solaris
/dev/sda2 * 4208640 83886079 39838720 83 Linux
/dev/sda3 83886080 167772159 41943040 83 Linux
/dev/sda4 167772160 272629759 52428800 83 Linux
BTW, how to add this new 50 GB disk space into /dev/sda2? I heard that we can use resize2fs, fsck, and so on. Please share on how to add this extra disk space without affecting the data in /dev/sda2.
Thanks in advance.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Similar to above, but create the last 50GB partition as sda5, ensure no one uses /opt/repo and copy to sda5 online without boot it from the DVD. After copy, remount /opt/repo to new partition, and don't forget to change mount point in /etc/fstab then reboot. Now you can delete partition sda3 and use it to extend sda2 about 40G.
ASKER
Hi Joseph,
Give me some time to try it.
Give me some time to try it.
ASKER
Thanks for Member_2_406981, I tried your 2nd option, and it works like a charm.