Google Answers Logo
View Question
 
Q: Drive Partitioning. ( No Answer,   31 Comments )
Question  
Subject: Drive Partitioning.
Category: Computers > Operating Systems
Asked by: asher12-ga
List Price: $25.00
Posted: 19 Sep 2004 21:29 PDT
Expires: 19 Oct 2004 21:29 PDT
Question ID: 403547
I recently purchased LaCie's Bigger Disc
(http://lacie.com/products/product.htm?id=10118) and I want to
partition it with four separate partitions, and I plan to install an
operating system on three of the partitions, (Macintosh 10.3, Windows
XP Pro, and Mandrake Linux) leaving the fourth for general storage.
     The only computer I have access to right now is a Macintosh, (I
have a windows box, but it's currently not working) and the disk
utility that comes with Macintosh 10.3 only lets you a partition a
drive to Mac OS Extended, Mac OS Standard, or UFS, and I believe that
none of those will support the Windows operating system or the Linux
operating system, so I need to know which format the individual
partitions have to be to support Windows and Linux, and I need an
application that will run in Mac OS 10.3 that can partition a drive to
any of the required partitions (Mac OS Extended, NTFS, FAT32, etc.)

Thanks!

Request for Question Clarification by leapinglizard-ga on 19 Sep 2004 22:07 PDT
The classic UNIX utility for disk partitioning -- and the Mac OS is
now a UNIX derivative -- is called fdisk. I don't know for sure that
it's installed by default, but I bet it is. Could you just check to
make sure?

With fdisk at hand, you'll be able to partition the drive however you
like. The business of formatting each partition with a particular file
system, such as VFAT or EXT3, is actually carried out by specialized
file-system programs, but fdisk will talk to them on your behalf. For
example, if I start up fdisk on one of my machines, I get the
following output.


> sudo fdisk /dev/hda

The number of cylinders for this disk is set to 4865.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): m
Command action
   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   q   quit without saving changes
   s   create a new empty Sun disklabel
   t   change a partition's system id
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit
   x   extra functionality (experts only)

Command (m for help): p

Disk /dev/hda: 40.0 GB, 40020664320 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1          10       80293+  83  Linux
/dev/hda2              11        2399    19189642+  83  Linux
/dev/hda3            2400        4799    19278000    f  W95 Ext'd (LBA)
/dev/hda4            4800        4865      530145   83  Linux
/dev/hda5            2400        4799    19277968+  83  Linux

Command (m for help): l

 0  Empty           1c  Hidden W95 FAT3 70  DiskSecure Mult bb  Boot Wizard hid
 1  FAT12           1e  Hidden W95 FAT1 75  PC/IX           be  Solaris boot   
 2  XENIX root      24  NEC DOS         80  Old Minix       c1  DRDOS/sec (FAT-
 3  XENIX usr       39  Plan 9          81  Minix / old Lin c4  DRDOS/sec (FAT-
 4  FAT16 <32M      3c  PartitionMagic  82  Linux swap      c6  DRDOS/sec (FAT-
 5  Extended        40  Venix 80286     83  Linux           c7  Syrinx         
 6  FAT16           41  PPC PReP Boot   84  OS/2 hidden C:  da  Non-FS data    
 7  HPFS/NTFS       42  SFS             85  Linux extended  db  CP/M / CTOS / .
 8  AIX             4d  QNX4.x          86  NTFS volume set de  Dell Utility   
 9  AIX bootable    4e  QNX4.x 2nd part 87  NTFS volume set df  BootIt         
 a  OS/2 Boot Manag 4f  QNX4.x 3rd part 8e  Linux LVM       e1  DOS access     
 b  W95 FAT32       50  OnTrack DM      93  Amoeba          e3  DOS R/O        
 c  W95 FAT32 (LBA) 51  OnTrack DM6 Aux 94  Amoeba BBT      e4  SpeedStor      
 e  W95 FAT16 (LBA) 52  CP/M            9f  BSD/OS          eb  BeOS fs        
 f  W95 Ext'd (LBA) 53  OnTrack DM6 Aux a0  IBM Thinkpad hi ee  EFI GPT        
10  OPUS            54  OnTrackDM6      a5  FreeBSD         ef  EFI (FAT-12/16/
11  Hidden FAT12    55  EZ-Drive        a6  OpenBSD         f0  Linux/PA-RISC b
12  Compaq diagnost 56  Golden Bow      a7  NeXTSTEP        f1  SpeedStor      
14  Hidden FAT16 <3 5c  Priam Edisk     a8  Darwin UFS      f4  SpeedStor      
16  Hidden FAT16    61  SpeedStor       a9  NetBSD          f2  DOS secondary  
17  Hidden HPFS/NTF 63  GNU HURD or Sys ab  Darwin boot     fd  Linux raid auto
18  AST SmartSleep  64  Novell Netware  b7  BSDI fs         fe  LANstep        
1b  Hidden W95 FAT3 65  Novell Netware  b8  BSDI swap       ff  BBT

Command (m for help): q


Looks promising, wouldn't you say? Why don't you check to make sure
you have fdisk, then report back and let me know what specific
information you'd like me to provide about partitioning and
formatting.

leapinglizard

Clarification of Question by asher12-ga on 19 Sep 2004 22:29 PDT
I started fdisk through the bash shell, and I do have it, but the
output I receive is pretty different than yours:

Asher-Markss-Computer:~ ashermarks$ fdisk
usage: fdisk [-ieu] [-f mbrboot] [-c cyl -h head -s sect] [-S size]
[-r] [-a style] disk
        -i: initialize disk with new MBR
        -u: update MBR code, preserve partition table
        -e: edit MBRs on disk interactively
        -f: specify non-standard MBR template
        -chs: specify disk geometry
        -S: specify disk size
        -r: read partition specs from stdin (implies -i)
        -a: auto-partition with the given style
        -d: dump partition table
        -y: don't ask any questions
        -t: test if disk is partitioned
`disk' is of the form /dev/rdisk0.
auto-partition styles:
  boothfs     8Mb boot plus HFS+ root partition (default)
  bootufs     8Mb boot plus UFS root partition
  hfs         Entire disk as one HFS+ partition
  ufs         Entire disk as one UFS partition
  dos         Entire disk as one DOS partition
  raid        Entire disk as one 0xAC partition
Asher-Markss-Computer:~ ashermarks$ 

I'd like the specific information (which commands to enter) to make
one 40 gigabyte Macintosh partition, one 20 gigabyte Linux partition,
and one 871.5 gigabyte Windows partition (The total size of the disk
is 931.5GB, according to disk utility.)

Request for Question Clarification by leapinglizard-ga on 20 Sep 2004 08:18 PDT
You're right, that is very different. I'm afraid I have no experience
with that version of the fdisk utility. Perhaps another Researcher
will be able to help you in this matter.

leapinglizard
Answer  
There is no answer at this time.

Comments  
Subject: Re: Drive Partitioning.
From: cscguy-ga on 21 Sep 2004 14:09 PDT
 
That sounds like the fdisk provided by Darwin, is that the particular
fdisk in question?
Subject: Re: Drive Partitioning.
From: asher12-ga on 21 Sep 2004 14:16 PDT
 
Yes, it is. Can you help, cscguy?
Subject: Re: Drive Partitioning.
From: cscguy-ga on 21 Sep 2004 14:24 PDT
 
Ah, yes, the fdisk utility included in MacOS X is an exact derivative
of the fdisk utility included in FreeBSD. You do not need a third
party utility to partition, if you have no intention of preserving the
contents of the disk. So in other words, if you intend to start clean
on the drive, you can simply use the fdisk terminal utility included
in OSX/Darwin to do so. You can first type man fdisk in the OSX
terminal and you will get a manual page similar to that found here...
http://www.ss64.com/osx/fdisk.html

OSX actually has two partition tools. pdisk is primarily for creating
MacOS X type disk structures. You will definitely need to use the
fdisk utility to create DOS based partitions.
You may want to try fdisk -e /dev/rdisk0 and see if you can
interactively set up the partitions as you want them setup.
Subject: Re: Drive Partitioning.
From: cscguy-ga on 21 Sep 2004 14:32 PDT
 
Once you are in that interactive configuration you can type edit and a
partition number to actually edit that particular partition. Once you
are editing that partition, you can type ? to get a huge list of all
the partition types you can possibly set. 82/83 being Linux filesystem
types, 86/87 being NTFS based filesystem types, A8, AB, AF being OSX
based filesystems.
Subject: Re: Drive Partitioning.
From: asher12-ga on 21 Sep 2004 19:30 PDT
 
Wow, thank you so much, I'm pretty sure I'll be able to figure it out from here.
Subject: Re: Drive Partitioning.
From: asher12-ga on 21 Sep 2004 19:41 PDT
 
Man, I feel incredibly stupid, I'm not used to this utility, so I'm
having trouble even finding the disk that I want to edit. Do you know
what it would be labeled as (/dev-whatever-) if it's the first
external drive plugged in?
Subject: Re: Drive Partitioning.
From: cscguy-ga on 22 Sep 2004 10:17 PDT
 
Not sure if this works in OSX or not, but try typing dmesg, and seeing
if it tells you what you need to know.
Subject: Re: Drive Partitioning.
From: asher12-ga on 22 Sep 2004 14:55 PDT
 
Nope, that doesn't help.
Subject: Re: Drive Partitioning.
From: cscguy-ga on 22 Sep 2004 18:18 PDT
 
Doesn't OSX already automount the drive when you first attempt to
connect it? If it does that, then in a terminal type mount to figure
out the device. Once you have the device then you can manually fdisk
it anyway you want it to be.
Subject: Re: Drive Partitioning.
From: asher12-ga on 22 Sep 2004 22:53 PDT
 
Okay, it didn't show up on mount until I gave it a partition (I used
disk utility) and now it's showing up as '/dev/disk2s3' when I try and
edit disk2s3 it tells me '/dev/disk2s3: Device busy' and when I try
and edit disk2 it tells me '/dev/disk2 is not a character device or
regular file'
I'm pretty sure I'm making progress, though!
Subject: Re: Drive Partitioning.
From: cscguy-ga on 23 Sep 2004 08:51 PDT
 
Yes, before you can modify the partition table, you must unmount the
harddrive. I am pretty sure you want to modify /dev/rdisk2 because
/dev/disk2s3 tells fdisk that you want to create subpartitions inside
of the slice. This is NOT what you want to do. Instead you want to
create actual slices. Darwin like BSD, most likely has slices which
are then logically partitioned into partitions. In other words,
partitions with subpartitions. You are only interested in creating the
slices NOT the subpartitions. The important thing was to mount the
drive with OSX so that you knew what device it was. It is important to
unmount it before you fdisk it, otherwise the drive can and may even
be in use by some background process in OSX. You can probably type
umount /dev/disk2s3 and make sure none of the other disk2 slices are
mounted before you try fdisking. Hopefully this helps. Too bad it is
so complicated too, you would have thought Apple would have made other
partitions easy to make also, but I guess they are only worried about
Apple partitions and OSX. heh
Subject: Re: Drive Partitioning.
From: asher12-ga on 23 Sep 2004 13:57 PDT
 
Okay, I umounted disk2s3, and I couldn't find any other slices, and
now when I try and edit it, I get this.
[Asher-Markss-Computer:~] ashermar% fdisk /dev/disk2s3
fdisk: /dev/disk2s3 is not a character device or a regular file
And this is after I umounted it, and if I try and edit it while it's
mounted, it tells me it's busy.
Subject: Re: Drive Partitioning.
From: cscguy-ga on 23 Sep 2004 17:09 PDT
 
try fdisk -e /dev/rdisk2
Subject: Re: Drive Partitioning.
From: asher12-ga on 23 Sep 2004 17:18 PDT
 
Okay, that's working, but the thing is, it's letting me work on it
while it's mounted, which i thought shoudl ahve given me the 'device
busy' error. Are we sure it's the right drive?
Subject: Re: Drive Partitioning.
From: asher12-ga on 23 Sep 2004 17:24 PDT
 
I've established pretty firmly that it's the right drive, but I don't
know what alot of things are, like, I tell it which format I want ti
to be, and it asks me questions like, do I want to use CHS mode, what
the partition offset should be, what the partition size should be (and
it gives me a range from 1-1953588672, and I don't know if that's
bytes, kilobytes, etc.) what the BIOS starting cylinder is, etc. So,
if you could give me any help with that, it'd be much appreciated.
Subject: Re: Drive Partitioning.
From: cscguy-ga on 23 Sep 2004 17:24 PDT
 
Well, before you connect the drive, in terminal type mount, then after
you connect the drive, type mount again and see what new device was
mounted. Then you will be sure you are using the right device as you
partition.
Subject: Re: Drive Partitioning.
From: cscguy-ga on 23 Sep 2004 17:25 PDT
 
Let me boot OSX on my OSX emulator real quick, and I'll take a look.
Subject: Re: Drive Partitioning.
From: cscguy-ga on 23 Sep 2004 17:27 PDT
 
CHS stands for cylinders heads sectors. I believe if you choose no,
like it defaults to, that it uses blocks to determine size.
Subject: Re: Drive Partitioning.
From: cscguy-ga on 23 Sep 2004 17:36 PDT
 
What you can do is take the total number of sectors it provides to
you, and divide it up into half or thirds or quarters, and then
partition as such. Otherwise, without it giving you the option to
specify megabytes, gigabytes, I think it will be very difficult.
Unfortunately, from what I can see in the util, there is no easy way.
Subject: Re: Drive Partitioning.
From: asher12-ga on 23 Sep 2004 19:47 PDT
 
Well, that's the thing, it isn't that simple. See, the drive is 930ish
gigs, and I want one 850 gigabyte NTFS partition, one 50 gig Mac OS
partition, and one 30 gig Linux partition. So, I don't know exactly
what size to set them at, because it's no clear fraction. Also, what
the heck is 'partition offset' And one last thing: For the Windows
NTFS partition, should I use 86 (NT FAT VS) or 87 (NTFS VS) For the
Linux partition, should I use 82 (Linux swap*) or 83 (Linux files*)
and lastly, for the Mac partition, I have -no- idea what to use. By
the way, you have no idea how helpful you're being, you're an absolute
godsend. :)
Subject: Re: Drive Partitioning.
From: cscguy-ga on 23 Sep 2004 20:26 PDT
 
Hahaha, well thanks. I try to be helpful to anyone in need. Yeah, the
really difficult part in all this is knowing exactly how many sectors
represents the exact megabyte/gigabyte size you want. Normally fdisk
utilities let you specify the size in sectors or megabytes/gigabytes
so this particular version is more like openbsd's fdisk. As for the
offset, that specifies the exact position on the harddrive you want a
particular partition to occur at. So basically, if you partition using
this method, you can carve out chunks for each partition, and leave
free space between each one if you specify the offsets such that you
leave space between where one partition ends and another begins. This
could have some potential uses for example if you wanted to grow a
partition, and you used a growfs functionality to grow it after
reassigning the end of a partition or something. There isn't a whole
heck of a lot more I can help you with, though with sectors. The best
you can try to do is use MacOSX to create several MacOS partitions of
exactly the same sizes you want your other partitions to exist as, and
then use fdisk to find the exact sector sizes that represent the sizes
of the partitions you want. Yes, I know this is a pain, and surely
there should be another way, but I am almost at a loss of explaining
how to do it any other way. As for the partition types, I can try to
check what types I am using for my NTFS partitions. Linux uses 83 for
regular ext2/ext3 partitions, and 82 for a swap partition. MacOSX I
believe uses a8, but I am not positive on this. I will try to read up
on standard unix fdisk utilities and have a more exact answer on
exactly how you want to partition your drive.
Subject: Re: Drive Partitioning.
From: asher12-ga on 23 Sep 2004 21:35 PDT
 
Okay, let's see, if you tell me which NTFS partition I should use, I
think I'll be able to handle it, except I didn't see an A8 O.o Oh, and
I'm still kind of confused as far as the offset goes, what should I
set it too exactly, like, I would set the first partition to 1, the
second to 100, and the third to 200? And the last thing is, how do I
find out exactly how big a partition is, I can make a partition of the
right size using the Disk Utility, but I don't know how to check how
big it is, as far as sectors go.
Subject: Re: Drive Partitioning.
From: cscguy-ga on 24 Sep 2004 08:45 PDT
 
Ok, first of all a 931gig drive is pretty huge! Hehe, ok second of
all, you want fdisk -e /dev/rdisk2. Then you want to type edit 1, and
enter AF for HFS+ partition. The exact size in sectors is the tricky
part. Then you want to enter edit 2, enter 83 and specify the exact
size of the linux filesystem partition. Then you want to enter edit 3,
enter 82, and specify the exact size of the linux swap partition. Then
lastly you want to enter edit 4, enter 07, and specify the remainder
of the sectors.

The tricky part is figuring out the exact sizes for the sectors. The
way you do this is partitioning the 4 partitions exactly the size you
want them to be in MacOSX, and then I believe you will need to run
pdisk in order to retrieve the exact sector offsets and sizes you set.
So once you had that set you would run pdisk. Then you would type e,
and enter drive /dev/rdisk2. Then you would type p, and it should show
you the 4 macos partitions with their base (offset) and their length
(size in sectors) and then the size which should show their gigabyte
values also. Hopefully this helps.
Subject: Re: Drive Partitioning.
From: asher12-ga on 24 Sep 2004 13:37 PDT
 
What is the difference between the linux filesystem partition, and the
swap partition, and how big should the swap be if I want the main
filesystem to be 30 gigs?
Subject: Re: Drive Partitioning.
From: cscguy-ga on 24 Sep 2004 13:42 PDT
 
Swap is for virtual memory. On Linux this is handled by an external
partition. You generally want it about twice the amount of memory of
the machine it will be running on. But you can make it any size you
want, as long as it is at least the size of the memory.
Subject: Re: Drive Partitioning.
From: asher12-ga on 24 Sep 2004 15:08 PDT
 
Great! I'll be out of town for the rest of the weekend, maybe longer,
so I probably won't be able to do any of this until Monday, Wednesday
or Thursday at the latest. Don't forget about me! ;)
Subject: Re: Drive Partitioning.
From: asher12-ga on 29 Sep 2004 17:38 PDT
 
Wow. Okay. I'm back. I did everything you said, I used pdisk to find
out the exact offset and sizes, then I went to fdisk, set it all up,
used the print command to make sure it was all right, figured out that
it was, and used the 'write' command, to save the changes, and I get
this error saying something about improper device removal, and then
terminal printed something about setting the MBR to 0, or something. I
think I just used the command to partition it. So:
Once I have everything set up, all of the offsets, all of their sizes,
etc. What command do I use to finalize is it?
Subject: Re: Drive Partitioning.
From: asher12-ga on 02 Oct 2004 02:24 PDT
 
Aww man, did ya forget about me? We're so close, I can taste the paritions!
Subject: Re: Drive Partitioning.
From: cscguy-ga on 05 Oct 2004 22:51 PDT
 
I believe you use write. But I am not positive. I am not sitting in front of OSX.
Subject: Re: Drive Partitioning.
From: asher12-ga on 07 Oct 2004 13:43 PDT
 
Could you check, because it didn't work for me?
Subject: Re: Drive Partitioning.
From: asher12-ga on 07 Oct 2004 16:48 PDT
 
I did it all again, and tried 'write' here's what happened
fdisk:*1> write
Writing MBR at offset 0.
fdisk: /dev/rdisk1: Device busy
[Asher-Markss-Computer:~] ashermar% write
usage: write user [tty]
So, when I use the write command, it tells me the device is busy, and
quits fdisk, but if I dismount the different slices or rdisk1 (because
I can't umount just /dev/rdisk1, it gives me this:
[Asher-Markss-Computer:~] ashermar% umount /dev/rdisk1
umount: /dev/rdisk1: not a directory or special device)
So, when I dismount all of the slices of rdisk1, then try and use
fdisk to edit /dev/rdisk1 it works fine until I try and write to it,
then a Device Removal error window pops up in OSX

If any of that didn't make sense, let me know :)

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy