Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
## Display version, release, last git commit and git retrieval date of the script when asked: ##
#
# ./bootinfoscript -v
# ./bootinfoscript -V
# ./bootinfoscript --version
version () {
printf '\nBoot Info Script version: %s\nRelease date: %s' "${VERSION}" "${RELEASE_DATE}";
if [ ! -z "${LAST_GIT_COMMIT_SHORTLOG}" ] ; then
printf '\nLast git commit: %s\nCommit date: %s' \
"${LAST_GIT_COMMIT_SHORTLOG}" "${LAST_GIT_COMMIT_DATE}";
fi
printf '\n\n';
exit 0;
}
## Gzip a copy of the output file? ##
gzip_output=0; # off=0
## Write the output to the standard output instead of to a file? ##
stdout_output=0; # off=0
## Get arguments passed to the script. ##
process_args () {
if [ ${#@} -ge 1 ] ; then
# Process arguments.
case "$1" in
-g ) gzip_output=1; if [ ! -z "$2" ] ; then LogFile_cmd="$2"; fi;;
--gzip ) gzip_output=1; if [ ! -z "$2" ] ; then LogFile_cmd="$2"; fi;;
-h ) help;;
-help ) help;;
--help ) help;;
--stdout ) stdout_output=1;;
--update ) update "$2";;
-v ) version;;
-V ) version;;
--version ) version;;
-* ) help;;
* ) LogFile_cmd="$1";;
esac
fi
}
## Get arguments passed to the script. ##
process_args ${@};
## Display version number, release and git retrieval date. ##
printf '\nBoot Info Script %s [%s]' "${VERSION}" "${RELEASE_DATE}";
if [ ! -z "${LAST_GIT_COMMIT_SHORTLOG}" ] ; then
printf '\n Last git commit: %s\n Commit date: %s' \
"${LAST_GIT_COMMIT_SHORTLOG}" "${LAST_GIT_COMMIT_DATE}";
fi
printf '\n\n';
## Check whether Boot Info Script is run with root rights or not. ##
if [ $(type whoami > /dev/null 2>&1 ; echo $?) -ne 0 ] ; then
echo 'Please install "whoami" and run Boot Info Script again.' >&2;
exit 1;
elif [ $(whoami) != 'root' ] ; then
cat <<- EOF >&2
Please use "sudo" or become "root" to run this script.
Run the script as sudoer:
sudo ${0} <outputfile>
or if your operating system does not use sudo:
su -
${0} <outputfile>
For more info, see the help:
${0} --help
EOF
exit 1;
fi
## Check if all necessary programs are available. ##
# Programs that are in /bin or /usr/bin.
Programs='
basename
cat
chown
dd
dirname
expr
fold
grep
gzip
hexdump
ls
mkdir
mktemp
mount
printf
pwd
rm
sed
sort
tr
umount
wc'
# Programs that are in /usr/sbin or /sbin.
Programs_SBIN='
blkid
fdisk
filefrag
losetup'
Check_Prog=1;
for Program in ${Programs} ${Programs_SBIN}; do
if [ $(type ${Program} > /dev/null 2>&1 ; echo $?) -ne 0 ] ; then
echo "\"${Program}\" could not be found." >&2;
Check_Prog=0;
fi
done
## Can we decompress a LZMA stream? ##
#
# The Grub2 (v1.99-2.00) core_dir string is contained in a LZMA stream.
# See if we have xz or lzma installed to decompress the stream.
#
if [ $(type xz > /dev/null 2>&1 ; echo $?) -eq 0 ] ; then
UNLZMA='xz --format=lzma --decompress';
elif [ $(type lzma > /dev/null 2>&1 ; echo $?) -eq 0 ] ; then
UNLZMA='lzma -cd';
else
UNLZMA='none';
fi
## Do we have gawk or (a recent) mawk? ##
#
# If we don't have gawk, look for "mawk v1.3.4" or newer.
#
if [ $(type gawk > /dev/null 2>&1 ; echo $?) -eq 0 ] ; then
# Set awk binary to gawk.
AWK='gawk';
elif [ $(type mawk > /dev/null 2>&1 ; echo $?) -eq 0 ] ; then
MAWK_version="$(mawk -W version 2>&1)";
MAWK_version="${MAWK_version:0:10}";
if [ "${MAWK_version}" = 'mawk 1.3.3' ]; then
printf '"mawk v1.3.3" has known bugs.\nInstall "mawk v1.3.4" or newer from http://invisible-island.net/mawk/ or use "gawk" instead.\n' >&2;
Check_Prog=0;
else
# Set awk binary to mawk (version 1.3.4 or higher).
AWK='mawk';
fi
else
printf 'Install "gawk" or "mawk v1.3.4" (or newer) from http://invisible-island.net/mawk/.\n' >&2;
Check_Prog=0;
fi
if [ ${Check_Prog} -eq 0 ] ; then
printf '\nPlease install the missing program(s) and run Boot Info Script again.\n' >&2;
exit 1;
fi
## List of folders which might contain files used for chainloading. ##
Boot_Codes_Dir='
/
/NST/
'
The output of the df -h command you ran from the installed Kubuntu shows it is on sdb8. The new bootinfoscript shows vista on both sda3 and sdb3, don't know why sdb3 won't boot. Your grub.cfg shows sdb9 under set root but has the correct UUID for sdb8 and it boots. The /etc/fstab shows root was on /dev/sdb9 during install but the UUID is correct for sdb8 and it boots. What's your question?
The output of the df -h command you ran from the installed Kubuntu shows it is on sdb8. The new bootinfoscript shows vista on both sda3 and sdb3, don't know why sdb3 won't boot. Your grub.cfg shows sdb9 under set root but has the correct UUID for sdb8 and it boots. The /etc/fstab shows root was on /dev/sdb9 during install but the UUID is correct for sdb8 and it boots. What's your question?
My question is how to I reallocate the space. I think (I will have to check and probably won't be able now until Wednesday) I now know how to. Although I am still a little nervous/unsure about how to do this
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680
Rep:
Quote:
Originally Posted by davholla
My question is how to I reallocate the space. I think (I will have to check and probably won't be able now until Wednesday) I now know how to. Although I am still a little nervous/unsure about how to do this
As my craft teacher used to say "Measure twice, cut once." -- the reason for all these commands is to get a picture of your disk. Remember that you can't undo these changes and you can't expand a partition into space that's not next to it.
I gave you some options in post 28 but there are multiple possibilities. You need to make the decision on what you want and your are right to be nervous about it. Any time you are modifying your partition structure it will be a risk of loss of data. It would probably be best to do everything from a Live CD or flash drive with a Live Cd or else download and burn GParted to a CD and use that. The link below is to the GParted Manual which you could review before beginning as it covers deleting, formatting and creating new partitions as well as pretty much anything else a partition manager could be used for.
I gave you some options in post 28 but there are multiple possibilities. You need to make the decision on what you want and your are right to be nervous about it. Any time you are modifying your partition structure it will be a risk of loss of data. It would probably be best to do everything from a Live CD or flash drive with a Live Cd or else download and burn GParted to a CD and use that. The link below is to the GParted Manual which you could review before beginning as it covers deleting, formatting and creating new partitions as well as pretty much anything else a partition manager could be used for.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.