LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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


Reply
  Search this Thread
Old 10-10-2017, 07:36 AM   #1
compused
Member
 
Registered: Oct 2006
Location: Melbourne Australia
Distribution: centos and redhat 8
Posts: 91

Rep: Reputation: 15
Disk "" given in clearpart command does not exist


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 ]];
Thanks
Compused
 
Old 10-11-2017, 02:03 AM   #2
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
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.
 
Old 10-11-2017, 05:29 AM   #3
compused
Member
 
Registered: Oct 2006
Location: Melbourne Australia
Distribution: centos and redhat 8
Posts: 91

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by ondoho View Post
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
Attached Files
File Type: txt diskconf.include.txt (5.9 KB, 138 views)
 
Old 10-14-2017, 02:45 PM   #4
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
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.
 
Old 10-16-2017, 09:02 PM   #5
compused
Member
 
Registered: Oct 2006
Location: Melbourne Australia
Distribution: centos and redhat 8
Posts: 91

Original Poster
Rep: Reputation: 15
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

Last edited by compused; 10-17-2017 at 03:48 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How could a computer technician use the "top" command with "ps" and "kill" to investigate how a system is misbehaving? geckono1 Linux - Newbie 13 07-03-2016 07:51 AM
Why do the "£inux" and "PSinux" satirical misspellings even exist?! LOL! Kenny_Strawn General 19 12-09-2010 02:01 PM
Command which gives "scsi disk out put and fdisk -l output" vnykr Linux - Enterprise 5 12-18-2008 10:58 PM
Standard commands give "-bash: open: command not found" even in "su -" and "su root" mibo12 Linux - General 4 11-11-2007 10:18 PM
Postgresql error FATAL: user "root" does not exist" cgetty Ubuntu 4 06-21-2005 02:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:03 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration