LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.

Notices

Reply
 
Search this Thread
Old 10-13-2012, 07:20 PM   #1
PeterSteele
Member
 
Registered: Jun 2012
Posts: 206

Rep: Reputation: Disabled
Issues creating partitions in %pre script


I have an automated CentOS install controlled through kickstart and I need to create my partitions in the %pre script using parted. I have code something like this:

Code:
%pre
dd if=/dev/zero of=/dev/vda bs=1M count=1
parted -s /dev/vda mklabel gpt
parted -s /dev/vda mkpart primary ext4 0 128
parted -s /dev/vda mkpart primary linux-swap 128 2G
parted -s /dev/vda -- mkpart primary ext4 2G -1
mkfs.ext4 /dev/vda1
mkfs.ext4 /dev/vda3
%end
This is straightforward enough, unfortunately it doesn't work quite right. Even though I create the partitions, they don't all exist in fact when the parted steps are done. Partition vda1 exists and the mkfs works as expected, however, vda3 isn't recognized by the system, and therefore the mkfs for that partition fails.

Logs I've captured shows the following errors:
Quote:
00:00:59,708 INFO : Warning: The resulting partition is not properly aligned for best performance.
00:00:59,775 INFO : Warning: The resulting partition is not properly aligned for best performance.
00:00:59,848 INFO : Warning: WARNING: the kernel failed to re-read the partit/var/log/anaconda.program.log
ion table on /dev/vda (Device or resource busy). As a result, it may not reflect all of your changes until after reboot.
00:00:59,947 INFO : Warning: WARNING: the kernel failed to re-read the partition table on /dev/vda (Device or resource busy). As a result, it may not reflect all of your changes until after reboot.
Clearly I cannot reboot in this case since I'm in the middle of an install. How can I force the partitions that I create with parted to be present and available in the subsequent format step?
 
Old 10-14-2012, 11:13 PM   #2
kumarat9pm
LQ Newbie
 
Registered: Dec 2006
Location: Hyderabad, India
Distribution: Redhat/Ubuntu
Posts: 3

Rep: Reputation: 0
This can be solved by using partx -a /dev/sda

Hi please have a look at below link.

http://thelinuxerrors.blogspot.com/2...ion-table.html
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a .deb file that extracts files to pre-determined directories Jeff91 Linux - Software 1 11-17-2010 12:02 PM
Creating partitions Whitestar Ubuntu 3 02-21-2007 05:45 PM
Question on creating more partitions than default ones, i.e. /home,/root partitions casmac Suse/Novell 1 12-20-2006 05:02 PM
Creating Partitions / image partitions ELEGANCE Linux - General 1 05-17-2006 07:37 AM
Creating Partitions adamb10 Slackware - Installation 4 03-30-2005 02:36 PM


All times are GMT -5. The time now is 02:51 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration