Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi
Trying to install a centos 7 based distro (freepbx) using a single USB device, but the anaconda installer stalls given the message:
Quote:
Disk "" given in clearpart command does not exist
Prior to the clearpart command, the script does not seem to like a removable disc install, viz:
Code:
%pre --log /root/diskpart.log --interpreter /bin/bash
set -x -v
exec 1>/tmp/ks-pre.log 2>&1
# Function for joining arrays together
function join { local IFS="$1"; shift; echo "$*"; }
# Function to get explicit by-id of device
function getid {
# Make sure we change ! to / for /dev/cciss/c0d0 etc.
DEV=$(echo $1 | sed 's^!^/^')
DEVID=$(/usr/sbin/udevadm info --query=property --name=/dev/$DEV | grep DEVLINKS= | cut -d= -f2 | cut -d\ -f1)
# If we didn't get a device id, then just return the path. This can happen
# with virtual devices.
if [ ! "$DEVID" ]; then
echo $DEV
else
echo $DEVID
fi
}
# Is this machine booted in EFI mode? Assume no.
UEFI=false
[[ -e /sys/firmware/efi ]] && UEFI=true
COUNT=0
# Get a list of our disks on this machine
lsblk -bdrno KNAME,TYPE,SIZE,RM,HCTL > /tmp/lsblk.out
# Loop throught them
while read DEV TYPE SIZE RM HCTL; do
# If it's not a disk, ignore
if [[ $TYPE != "disk" ]]; then
continue;
fi
# If it's a ram disk, ignore
if [[ $DEV == zram* ]]; then
continue;
fi
# Automatically ignore any removable devices
#
# TODO: This may need more work. (Check for 8gb or less?)
#
if [[ $RM == 1 ]]; then
continue;
fi
COUNT=$(( $COUNT + 1 ))
DEVICE[${COUNT}]=$(getid $DEV)
STDDEVICE[${COUNT}]=$DEV
SIZE[${COUNT}]="$SIZE"
TYPE[${COUNT}]="$TYPE"
# Make sure there's not any biosraid cruft on the device, which causes anaconda to crash
dd if=/dev/zero of=$DEV bs=512 seek=$(( $(blockdev --getsz /dev/$DEV) - 1024 )) count=1024
done < /tmp/lsblk.out
echo "creating partitioning config"
VALIDDRIVES=$(join , ${DEVICE[*]})
# Are we not doing LVM?
if [[ "$(grep nolvm /proc/cmdline)" ]]; then
# Nuke the disk's current partition information
D=/dev/${STDDEVICE[1]}
dd if=/dev/zero of=$D bs=1M count=1
parted -s $D mklabel msdos
# Create root, swap, and make it active.
if [[ "$(grep tiny-10g /proc/cmdline)" ]]; then
parted -a optimal -s $D mkpart primary ext3 0% 9G
parted -a optimal -s $D mkpart primary linux-swap 9G 10G
else
parted -a optimal -s $D mkpart primary ext3 0% 95%
parted -a optimal -s $D mkpart primary linux-swap 95% 100%
fi
parted -s $D set 1 boot on
partprobe $D
cat << EOF > /tmp/partitioning
zerombr
bootloader --boot-drive=${DEVICE[1]} --driveorder=$(join , ${STDDEVICE[*]}) --append="net.ifnames=0 biosdevname=0"
part / --label=root --fstype ext3 --onpart=${D}1
part swap --onpart=${D}2
EOF
exit
fi
# Otherwize
cat << EOF > /tmp/partitioning
zerombr
clearpart --initlabel --all --drives=${VALIDDRIVES}
bootloader --boot-drive=${DEVICE[1]} --driveorder=$(join , ${STDDEVICE[*]}) --append="net.ifnames=0 biosdevname=0"
reqpart
EOF
# Are we skipping HDD configuration?
if [[ "$(grep skip-hdd-setup /proc/cmdline)" ]]; then
exit
fi
Tried removing the line:
if [[ $RM == 1 ]]
but that did not help
Anyone can help?
Also does following coding allow for a solitary USB to be partitioned during the install to preserve the installation files? Here:
Code:
# Do we have a single device?
if [[ $COUNT == 1 ]]; then
echo "part /boot --label=bootvol --fstype ext4 --size=2000" >> /tmp/partitioning
echo "part pv.20 --label=rootvg --grow --size=4000" >> /tmp/partitioning
elif [[ $COUNT == 2 ]];
just to clarify, you are trying to install to a usb device? from what?
how do you know the changes to that script are integrated back into the installer you are trying to install with?
what is the origin of the script, and how and where does it integrate into the installation?
i see several things wrong with your assumptions about how this script works:
1. just removing one line vbreaks the script, you have to remove the whole if --- fi block.
2. if one of the tasks of the script is to skip usb drives, then it shouldn't choke on them
i'd rather you showed us more about this mysterious installation medium and installation process.
just to clarify, you are trying to install to a usb device? from what?
how do you know the changes to that script are integrated back into the installer you are trying to install with?
what is the origin of the script, and how and where does it integrate into the installation?
i see several things wrong with your assumptions about how this script works:
1. just removing one line vbreaks the script, you have to remove the whole if --- fi block.
2. if one of the tasks of the script is to skip usb drives, then it shouldn't choke on them
i'd rather you showed us more about this mysterious installation medium and installation process.
hi ondoho
attached is the discinfo.include(.txt) file from which the CODE above is excerpted. This is called from a file named base.ks (not attached)
yes, I should have advised that the whole if --- fi block was removed.
As an experiment, the system was booted with a live usb version of puppy linux, showing the live puppy linuc OS on sda1 and another usb disc seen as sdb1. Is there anyway I could boot the install from sdb1 in this case (ie as if sdb1 was a cd-rom drive with an installation cd on it)?
Thanks
Compused
Bash is NOT C. You probably want to use = instead of ==, or the posix method of -eq. Otherwise results might be unexpected, where 1 equals TRUE, not a string "1", vice versa or other quirks.
thanks
was trying to install from a usb, to another usb. There is no HDD.
Centos 7 by itself will let you to that with the assistance of a graphical install and I was seeking a way of modifying this script to allow the additional software as included in a freepbx distro, to be installed...
However, have now completed this in two steps.
Compused
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.