Copying files from Bootable USB to local Drive in %post script of kickstart Announcing the...
Around usage results
Can a party unilaterally change candidates in preparation for a General election?
Does classifying an integer as a discrete log require it be part of a multiplicative group?
How would a mousetrap for use in space work?
What's the meaning of "fortified infraction restraint"?
2001: A Space Odyssey's use of the song "Daisy Bell" (Bicycle Built for Two); life imitates art or vice-versa?
Is it ethical to give a final exam after the professor has quit before teaching the remaining chapters of the course?
Is safe to use va_start macro with this as parameter?
Why do we bend a book to keep it straight?
Where are Serre’s lectures at Collège de France to be found?
When a candle burns, why does the top of wick glow if bottom of flame is hottest?
If a VARCHAR(MAX) column is included in an index, is the entire value always stored in the index page(s)?
First console to have temporary backward compatibility
Do I really need recursive chmod to restrict access to a folder?
Would "destroying" Wurmcoil Engine prevent its tokens from being created?
Dating a Former Employee
Most bit efficient text communication method?
How can I use the Python library networkx from Mathematica?
How to convince students of the implication truth values?
8 Prisoners wearing hats
Fantasy story; one type of magic grows in power with use, but the more powerful they are, they more they are drawn to travel to their source
How to Make a Beautiful Stacked 3D Plot
Denied boarding although I have proper visa and documentation. To whom should I make a complaint?
Is it a good idea to use CNN to classify 1D signal?
Copying files from Bootable USB to local Drive in %post script of kickstart
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
2019 Community Moderator Election Results
Why I closed the “Why is Kali so hard” questionMaking Bootable USB, problems copying /procMySQL service doesn't startno ext2/ext3/ext4 directory in /lib/modules/linux version/kernel/fs/linux /dev/root does not exist after custom ISO build of CentOS 7CentOS custom ISO installation - /dev/root does not existWhy is my udev mounted device not staying put?Can I create files in kickstart %pre, then later access those same files during RPM package installation and/or kickstart %post?Kickstart script seems to be skipping over %postHow to See Bound Folders and Release ThemKickstart Post Issue
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}
I have created bootable USB with custom folder in it, After installation i want to copy files from USB to local directory, Following is kickstart file %post section
%post --nochroot --erroronfail --log=/mnt/sysimage/root/ks-post.log
cp -af /run/install/repo/custom/Router_CFG.ini /var/lib/tftpboot
%end
Above code throws error that /var/lib/tftpboot directory doesnt exist, i removed --nochroot
%post --erroronfail --log=/mnt/sysimage/root/ks-post.log
cp -af /run/install/repo/custom/Router_CFG.ini /var/lib/tftpboot
%end
and now it complain that USB mount point (/run/install/repo) is not available.
Then i tried to mount USB drive
%post --erroronfail --log=/mnt/sysimage/root/ks-post.log
mkdir /mnt/myusb
usbblkid=$(blkid -L "CentOS 7 x86_64")
mount $usbblkid /mnt/myusb
cp -af /mnt/myusb/custom/Router_CFG.ini /var/lib/tftpboot
%end
Now its throwing error
mount: Special device /dev/sdc1 doese not exist
linux centos kickstart
add a comment |
I have created bootable USB with custom folder in it, After installation i want to copy files from USB to local directory, Following is kickstart file %post section
%post --nochroot --erroronfail --log=/mnt/sysimage/root/ks-post.log
cp -af /run/install/repo/custom/Router_CFG.ini /var/lib/tftpboot
%end
Above code throws error that /var/lib/tftpboot directory doesnt exist, i removed --nochroot
%post --erroronfail --log=/mnt/sysimage/root/ks-post.log
cp -af /run/install/repo/custom/Router_CFG.ini /var/lib/tftpboot
%end
and now it complain that USB mount point (/run/install/repo) is not available.
Then i tried to mount USB drive
%post --erroronfail --log=/mnt/sysimage/root/ks-post.log
mkdir /mnt/myusb
usbblkid=$(blkid -L "CentOS 7 x86_64")
mount $usbblkid /mnt/myusb
cp -af /mnt/myusb/custom/Router_CFG.ini /var/lib/tftpboot
%end
Now its throwing error
mount: Special device /dev/sdc1 doese not exist
linux centos kickstart
add a comment |
I have created bootable USB with custom folder in it, After installation i want to copy files from USB to local directory, Following is kickstart file %post section
%post --nochroot --erroronfail --log=/mnt/sysimage/root/ks-post.log
cp -af /run/install/repo/custom/Router_CFG.ini /var/lib/tftpboot
%end
Above code throws error that /var/lib/tftpboot directory doesnt exist, i removed --nochroot
%post --erroronfail --log=/mnt/sysimage/root/ks-post.log
cp -af /run/install/repo/custom/Router_CFG.ini /var/lib/tftpboot
%end
and now it complain that USB mount point (/run/install/repo) is not available.
Then i tried to mount USB drive
%post --erroronfail --log=/mnt/sysimage/root/ks-post.log
mkdir /mnt/myusb
usbblkid=$(blkid -L "CentOS 7 x86_64")
mount $usbblkid /mnt/myusb
cp -af /mnt/myusb/custom/Router_CFG.ini /var/lib/tftpboot
%end
Now its throwing error
mount: Special device /dev/sdc1 doese not exist
linux centos kickstart
I have created bootable USB with custom folder in it, After installation i want to copy files from USB to local directory, Following is kickstart file %post section
%post --nochroot --erroronfail --log=/mnt/sysimage/root/ks-post.log
cp -af /run/install/repo/custom/Router_CFG.ini /var/lib/tftpboot
%end
Above code throws error that /var/lib/tftpboot directory doesnt exist, i removed --nochroot
%post --erroronfail --log=/mnt/sysimage/root/ks-post.log
cp -af /run/install/repo/custom/Router_CFG.ini /var/lib/tftpboot
%end
and now it complain that USB mount point (/run/install/repo) is not available.
Then i tried to mount USB drive
%post --erroronfail --log=/mnt/sysimage/root/ks-post.log
mkdir /mnt/myusb
usbblkid=$(blkid -L "CentOS 7 x86_64")
mount $usbblkid /mnt/myusb
cp -af /mnt/myusb/custom/Router_CFG.ini /var/lib/tftpboot
%end
Now its throwing error
mount: Special device /dev/sdc1 doese not exist
linux centos kickstart
linux centos kickstart
edited 14 hours ago
ImranRazaKhan
asked 14 hours ago
ImranRazaKhanImranRazaKhan
1033
1033
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Your first attempt was almost correct. Try it this way:
%post --nochroot --erroronfail --log=/mnt/sysimage/root/ks-post.log
cp -af /run/install/repo/custom/Router_CFG.ini /mnt/sysimage/var/lib/tftpboot
%end
When using %post --nochroot
, the root of the new system will be at /mnt/sysimage
so you'll need to prefix it to all the paths referring to the new system you're installing. The installation media will be at /run/install/repo
.
If you remove the --nochroot
, then the root of the new system will be at /
, but the installation media will be inaccessible without extra steps.
Your second attempt might have worked if done like this (adapted from a working RHEL7.2 postinstall configuration I made and tested earlier):
%post --erroronfail --log=/root/ks-post.log
mkdir /mnt/myusb
mount /dev/disk/by-label/CentOS*7*x86_64 /mnt/myusb
cp -af /mnt/myusb/custom/Router_CFG.ini /var/lib/tftpboot
umount /mnt/myusb
rmdir /mnt/myusb
%end
thanks it really helped me.
– ImranRazaKhan
11 hours ago
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f513008%2fcopying-files-from-bootable-usb-to-local-drive-in-post-script-of-kickstart%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Your first attempt was almost correct. Try it this way:
%post --nochroot --erroronfail --log=/mnt/sysimage/root/ks-post.log
cp -af /run/install/repo/custom/Router_CFG.ini /mnt/sysimage/var/lib/tftpboot
%end
When using %post --nochroot
, the root of the new system will be at /mnt/sysimage
so you'll need to prefix it to all the paths referring to the new system you're installing. The installation media will be at /run/install/repo
.
If you remove the --nochroot
, then the root of the new system will be at /
, but the installation media will be inaccessible without extra steps.
Your second attempt might have worked if done like this (adapted from a working RHEL7.2 postinstall configuration I made and tested earlier):
%post --erroronfail --log=/root/ks-post.log
mkdir /mnt/myusb
mount /dev/disk/by-label/CentOS*7*x86_64 /mnt/myusb
cp -af /mnt/myusb/custom/Router_CFG.ini /var/lib/tftpboot
umount /mnt/myusb
rmdir /mnt/myusb
%end
thanks it really helped me.
– ImranRazaKhan
11 hours ago
add a comment |
Your first attempt was almost correct. Try it this way:
%post --nochroot --erroronfail --log=/mnt/sysimage/root/ks-post.log
cp -af /run/install/repo/custom/Router_CFG.ini /mnt/sysimage/var/lib/tftpboot
%end
When using %post --nochroot
, the root of the new system will be at /mnt/sysimage
so you'll need to prefix it to all the paths referring to the new system you're installing. The installation media will be at /run/install/repo
.
If you remove the --nochroot
, then the root of the new system will be at /
, but the installation media will be inaccessible without extra steps.
Your second attempt might have worked if done like this (adapted from a working RHEL7.2 postinstall configuration I made and tested earlier):
%post --erroronfail --log=/root/ks-post.log
mkdir /mnt/myusb
mount /dev/disk/by-label/CentOS*7*x86_64 /mnt/myusb
cp -af /mnt/myusb/custom/Router_CFG.ini /var/lib/tftpboot
umount /mnt/myusb
rmdir /mnt/myusb
%end
thanks it really helped me.
– ImranRazaKhan
11 hours ago
add a comment |
Your first attempt was almost correct. Try it this way:
%post --nochroot --erroronfail --log=/mnt/sysimage/root/ks-post.log
cp -af /run/install/repo/custom/Router_CFG.ini /mnt/sysimage/var/lib/tftpboot
%end
When using %post --nochroot
, the root of the new system will be at /mnt/sysimage
so you'll need to prefix it to all the paths referring to the new system you're installing. The installation media will be at /run/install/repo
.
If you remove the --nochroot
, then the root of the new system will be at /
, but the installation media will be inaccessible without extra steps.
Your second attempt might have worked if done like this (adapted from a working RHEL7.2 postinstall configuration I made and tested earlier):
%post --erroronfail --log=/root/ks-post.log
mkdir /mnt/myusb
mount /dev/disk/by-label/CentOS*7*x86_64 /mnt/myusb
cp -af /mnt/myusb/custom/Router_CFG.ini /var/lib/tftpboot
umount /mnt/myusb
rmdir /mnt/myusb
%end
Your first attempt was almost correct. Try it this way:
%post --nochroot --erroronfail --log=/mnt/sysimage/root/ks-post.log
cp -af /run/install/repo/custom/Router_CFG.ini /mnt/sysimage/var/lib/tftpboot
%end
When using %post --nochroot
, the root of the new system will be at /mnt/sysimage
so you'll need to prefix it to all the paths referring to the new system you're installing. The installation media will be at /run/install/repo
.
If you remove the --nochroot
, then the root of the new system will be at /
, but the installation media will be inaccessible without extra steps.
Your second attempt might have worked if done like this (adapted from a working RHEL7.2 postinstall configuration I made and tested earlier):
%post --erroronfail --log=/root/ks-post.log
mkdir /mnt/myusb
mount /dev/disk/by-label/CentOS*7*x86_64 /mnt/myusb
cp -af /mnt/myusb/custom/Router_CFG.ini /var/lib/tftpboot
umount /mnt/myusb
rmdir /mnt/myusb
%end
answered 13 hours ago
telcoMtelcoM
21.1k12553
21.1k12553
thanks it really helped me.
– ImranRazaKhan
11 hours ago
add a comment |
thanks it really helped me.
– ImranRazaKhan
11 hours ago
thanks it really helped me.
– ImranRazaKhan
11 hours ago
thanks it really helped me.
– ImranRazaKhan
11 hours ago
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f513008%2fcopying-files-from-bootable-usb-to-local-drive-in-post-script-of-kickstart%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown