i have installed RHEL on virtual machine using vmware. i have added the extra hard drive from vmware.
Now Linux is not showing that new hard drive installed.
HOw can i do that
Stack Exchange network consists of 181 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.Visit Stack Exchange
Server Fault is a question and answer site for system and network administrators. It only takes a minute to sign up.Sign up to join this community
Procedure that I use after you add the disk:
ls -l /dev/sd*. If you started with only one disk and added another you should see
fdisk /dev/sdband partition the disk. I'd recommend adding primary partition 1 using the entire disk.
/dev/sdb1is present. If so, then you can create a filesystem on the disk.
mkfs -t ext3 /dev/sdb1to create the new filesystem.
tune2fs -i 0 -c 0 -m 1 -e panic /dev/sdb1. This inhibits the inconvient full fscks at mounts after a number of days and/or number of mounts. The system will still fsck the filesystem if necessary. Only reserve 1% of the diskspace for the root user. Otherwise, the default is to basically reserve 10%. Panic the system once filesystem errors are detected, default is to continue operations with the filesystem R/O.
chmod 755 /mountpoint. VERY important.
add to the
/dev/sdb1 /mountpoint ext3 defaults 0 1
Reboot your system and and do a df and see that your mount is present and active.
ext4filesystem format instead of the
You need to use LVM. Just read section 9.5.6. Extending a volume group from http://www.centos.org/docs/5/html/Deployment_Guide-en-US/s1-system-config-lvm.html
If you've added the drive while the guest OS is still running, it doesn't know about the new drive yet. There are ways to force a system to look for new disks by forcing a scsi system scan. The easiest way to do this is to simply reboot the guest.
If you hot added a
SCSI disk, you can check check
dmesg to see if there is any info:
$ dmesg | grep sd
This should give you lots of information about the SCSI disks discovered. If for some reason you do not want/can reboot and the disk was not discovered, you can force a rescan of the SCSI bus by doing:
# echo "- - -" > /sys/class/scsi_host/hostX/scan
hostX should be a valid value, which you can get by executing:
If you have only one SCSI controller, then it should be
Once you executed this command the disk should be available if the vmware version supports hotadding disks. Look at the output of dmesg again.
If the version of vmware does not support hotadd (meaning it does not inform the guest os about this new hardware), just reboot.
After this, if the disk is not formatted you should do it. Decide whether you want to use LVM, or other type of partitions / filesystems. You could use fdisk, parted, etc, to create this partitions.
Finally you can mount the new partition by doing
# mount /dev/<device> /mount/point
Where could be something like sdb1. and
/mount/point is the place on the filesystem where you want this device to be mounted
/mnt, for example
Before adding the new drive, simply shutdown the VM then add the the new Disk then power on the VM again. Now you can check the new HDD via
fdisk -l (show all the available partitions and disks)
If you want to partition the new drive then use the following command
fdisk /dev/sdb (I assume sdb is the new drive, please check in your case
then press n for new partition)
Then follow the screen instructions, they are pretty straightforward.
A better way to partition the new drive is in this good article using "parted" which I followed: https://linuxhint.com/parted_linux/
This new partition will be visible after the VM guest is rebooted.
Also, I don't think editing the /etc/fstab is the right way to do it, but can't find any Red Hat article how to do it properly in the Linux command line.
On AIX it was not recommended to edit the /etc/fstab file, there is the tool "smitty" that does that correctly.
/etc/fstab.ddirectory and it may be better to add a new file there, there must be a readme file about how to use a directory. // It's a shame added disk don't appear without reboot. In Proxmox VE when you add a disk or even expand an existing disk, you may use newly allocated space immediately, without any reboots or other downtime. Feb 13, 2021 at 9:35