[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Command Line Partitioning



On Sat, 19 Feb 2011 11:49:41 -0500 (EST), Hal Vaughan wrote:
> 
> I have everything else worked out so it can be done in a batch mode
> or in a program, but I'm having trouble with partitioning.
> 
> I've been working with cfdisk, fdisk, and parted:
> 
> parted: Always leaves only 512 bytes at the start and grub-install
> doesn't seem to like that.  But it can be used in a batch mode.
> 
> fdisk: Doesn't seem to have a batch/script mode and I'd have to
> calculate sizes in megabytes from cylinder info
> 
> cfdisk: Lets me work in whatever units I like (bytes, kbytes, mbytes,
> and so on) but is curses based and doesn't have batch/script mode.
> 
> What I would like to do is to be able to use a partitioning program
> from a batch or script mode.  Parted would be good for that, but I
> can't seem to get it to leave more than 512 bytes at the start
> (cfdisk left 32k -- why?  I don't know).
> 
> Also, it seems when I get CF disks they have an MS-DOS partition
> table (grub kept noting that and one part of the whole process
> didn't seem to like that).  How can I either wipe the disk without
> a mess (tried zeroing it, parted wouldn't recognize it or write to
> it, but fdisk had no issue with that) or write a new partition table?
> What type of partition table should I use?  (I'm guessing bsd, which
> was one of the options, but there wasn't a Linux option for types of
> partition tables.)

Well, if I were in your situation I think I know what I would do.
I would use another boot loader besides grub2, such as lilo or
extlinux, that doesn't need to allocate sectors at the beginning
of the disk which are supposed to be unallocated (or in the case of
parted, are part of a partition).  Both lilo and extlinux can be
installed in either the master boot record or a partition boot sector
and are perfectly happy with the MS-DOS partitioning scheme.
With extlinux you are limited to either the ext2 or ext3 filesystem
for the /boot partition.  With lilo you can use just about anything
for a file system.  The down side of lilo is that the boot loader
installer has to be run any time the physical location of any
sector in the kernel image file or the initial RAM disk image file
changes.

I have a web page that you may find useful.  It is

   http://users.wowway.com/~zlinuxman/Kernel.htm

You may find it useful for several reasons.  First of all, it is
very common when working with embedded systems to create a custom
Linux kernel.  A "lean and mean" kernel is often created which contains
only the drivers which are actually needed for that particular
embedded system.  This saves hard disk space and memory space on
the embedded device (but not on the system on which one actually
compiles the kernel!)

Second, step 10, "Customize the Kernel Installation Environment",
contains stuff which is useful even to people who use stock
kernels.  For example, there is a section on how to switch to
lilo from another boot loader (in this case, grub 1 from Lenny)
and covers some little known stuff about lilo, such as how to
make use of UUIDs in lilo, how to determine the capabilities of
the BIOS, etc.  Third, if you are using a custom kernel built
in the manner recommended in the write-up, and you are using
lilo, you will probably need some extra "hook scripts" which
don't currently ship with lilo.  This write-up provides some
sample hook scripts which you may find useful.

Good luck with your project.
 
-- 
  .''`.     Stephen Powell    
 : :'  :
 `. `'`
   `-


Reply to: