Thanks but to all the other I had the returns in the wrong place

#!/bin/bash
#
# Short script to add the unpartitioned disk to the current root volume.
fdisk /dev/xvdb <<EOF
n
p
1


t
8e
w
EOF
pvcreate /dev/xvdb1
vgextend vg_centos /dev/xvdb1
lvextend -l 100%FREE /dev/vg_centos/lv_root
resize2fs /dev/mapper/vg_centos-lv_root





-----Original Message-----
From: Erdősi Péter [mailto:[email protected]] 
Sent: Saturday, December 13, 2014 9:37 PM
To: [email protected]
Subject: Re: Status of Root Disk Resize for XenServer

2014.12.14. 3:02 keltezéssel, Matthew Midgett írta:
>   I'd have to say that if the customer didn't ask for a data disk it would 
> just error and quit. Someone with some better scripting skills could possible 
> make it look for a un-partitioned drive and the only run the scrip if it 
> found one.
You can check disk existance like this:

[fazy(d:0)] <~> cat check
#!/bin/bash

if [ -e /dev/$1 ]; then
  echo "Found"
else
  echo "Not Found"
fi

And you can run: ./check xvdb

Regards,
  Peter

Reply via email to