[conspire] conspire Digest, Vol 48, Issue 4
Edmund J. Biow
biow at sbcglobal.net
Sat May 5 16:00:14 PDT 2007
> Date: Fri, 4 May 2007 15:43:03 -0700
> From: Rick Moen <rick at linuxmafia.com>
> Subject: Re: [conspire] Creating Home Partition
> To: conspire at linuxmafia.com
> Message-ID: <20070504224303.GU14422 at linuxmafia.com>
> Content-Type: text/plain; charset=us-ascii
>
> Quoting Edmund J. Biow (biow at sbcglobal.net):
>
>
>>> Date: Thu, 3 May 2007 17:20:29 -0700 From: Rick Moen
>>> <rick at linuxmafia.com>
>>>
>>> The article shows it being created as a logical partition. However
>>>
>>>
>>>>> when I do it using gparted the 2 choooses are primary and extended and
>>>>> logical is grayed out.
>>>>> Hdb1 Kanotics 17gb
>>>>> Hdb2 Swap 500 mb
>>>>> Hdb3 Ubuntu 20gb
>>>>> I read that logical partitions are contained within extended
>>>>> partitions. Should I use primary or extended for the free space.
>>>>>
>>>>
>>>>
>>> Since you're aiming to have only four filesystems total, on that
>>> physical drive, make life easy for yourself, and stick to primary.
>>>
>>>
>> My quibble about just creating a fourth primary partition is that it
>> doesn't leave as much flexibility to monkey with the file system later
>> as creating an extended partition and then a single logical partition.
>>
>
> At that point, you park one of the existing partitions' data somewhere,
> blow it away, make an extended partition in its place, and subdivide it
> into however many new partitions you want.
>
Or if you already have an extended partition, you simply resize it and
create your new partitions, bypassing all the tedious backing up and
restoring. Of course backing up before resizing is safer, but
presumably you already have your data backed up to at least one other
place since it is really not a question of 'if' a hard drive will fail
but 'when'.
>
>> Also, a 40 GB drive is pretty tight for 2 operating systems and user
>> files (he says typing this on his laptop with XP, SUSE 10.2 & Xubuntu
>> Edgy in 40 GB).
>>
>
> Ja. Me, I stick to one OS per system, generally speaking.
>
I have already paid my Microsoft tax, I'm not going to junk Windows XP,
even if I don't use it very often. Actually today I encountered a web
site (ShitiBank) that didn't want to let me use it with Linux (although
Firefox in Mac & Windows were supported). I was able to get around it.
Really, there are some things Microsoft does a lot better than Linux,
gaming, for one (not that I'm a gamer), and there are lots of great
Windows programs stranded in an operating system I don't really care for
much. Plus, I have hard ware that I can't use with Linux without a lot
of tedious hacking, my USB TV box for instance, although I've read that
it is supposed to be natively supported in 2.6.20, so I may give it
another throw the next time I upgrade. When I travel I sometimes have
to use my winmodem, as well, which is a pain to get going in Linux,
tainting the kernel. If you've already got Windows I would advocate
dual booting. If you are really paranoid, don't go online with Windows.
As to the third OS, I was having trouble making my previous distro (Blag
30k) work with my wireless gear so I decided to devote a 2.5 GB vfat
partition that I'd previously devoted to sharing data between Linux and
Windows to a Xubuntu installation. (These days with NTFS-3G & whatever
the Windows EXT3 drivers are named, it isn't too hard to write from one
OS to another without a VFAT partition.) It was more of an experiment
and I wanted to be able to fall back to my Blag install, since I was
very comfortable with it. Xubuntu is a little cramped, maybe (400 MB
left on the root partition), but fast and works with WPA-PSK & Beryl to
impress the masses. At various times I was able to get some
functionality with Xubuntu and other stuff only going with Opensuse, but
didn't have everything working with both, like I do now (printing,
wireless, WPA, Beryl.) I still haven't tackled hibernation and suspend,
but those are not important features to me, so I haven't really worked
on it.
Plus, every so often an OS gets scrambled, file corruption, ungrade
pains, whatever, I like having an extra Linux to boot in to if that
happens (though of course you can use a live CD). Generally I can sort
things out, but it often takes a while, but in the mean time its nice to
have a fall-back system.
>
>> You might want to move to a larger drive in the
>> future. Seems like a fast, easy way to do that would be to 'dd
>> if=/dev/hdb of=/dev/hdc' which seems to go a little more quickly than
>> rsync and copies over the master boot record and grub.
>>
>
> Um, that wouldn't be good, because that would prevent you from using the
> extra space, because it would copy over the smaller drive's image
> verbatim, including the bounds on allocated disk space.
>
> As I keep saying, "dd" is almost never the right tool.
>> But if you have four primary partitions you can't do much with the
>> extra space on the newer, bigger drive. However if you have an
>> extended partition it seems to me that you'd be able to just define a
>> new logical partition to use the extra space that the new drive
>> provides (though I haven't tried this yet).
>>
>
> Nope. Doesn't work that way. Basically, an extended partition denotes
> a beginning and ending cylinder, same as a primary one. The sole
> structural difference inherent in an extended-partition entry relative
> to a primary-partition one is that it has a flag set (in one of the
> underused bits out of the 16 bytes available in each of the partition
> tables 4 x 16 byte entries) that is interpreted as "Please look in the
> first sector of the expanse of cylinders I describe: You'll find a
> secondary partition table there, that explains how I'm further divvied
> up into logical drives."
>
> So, all you can do within that secondary partition table is carve up the
> extended partition's allocated space. And, if you "dd" a small drive's
> structure onto a large drive, the partition's cylinder limits will
> remain the same as before. Bad idea. Really bad way to initialise a
> larger drive.
>
It's all Black Magic to me, I don't know why anything works, but I'll
give you my experience. I used DD to clone my server's disk a few weeks
ago, then ran up against the 4 primary partition snafu, gparted wouldn't
let me claim more drive space, either by expanding hda4 or creating a
new partition. So I zapped the last two partitions and created new,
bigger ones and rsynced over just those two partitions from my old
drive, leaving the MBR and first two partitions intact from my DD
enterprise. It worked. Mind you, I still have four primary partitions,
so I am sure you are right about the extended partitions FAT limits. I
was actually very surprised that the DDed MBR worked fine with my new,
bigger partitions, since I thought it would have been confused by the
difference in cylinder boundaries. I was just pleased that I didn't
have to chroot and reinstall the MBR.
I suppose if you were ambitious and technically inclined you could edit
the MBR or an extended partition boot record with a hex editor, but as
Ted Kennedy said at Chappaquiddick, I'll drive off of that bridge when I
come to it.
DD, by the way, works like a charm if you have two identical hard
drives. I just cloned my new system for a friend who got the same
motherboard & HD, changed the passwords, hostnames, IP setup and wiped
my personal data and he was good to go. And DD seemed to be faster than
RSYNC.
>
>> I've never messed up a partition using a partition resizer,
>> though I'm sure it happens all the time (back up your data).
>>
>
> "Back up your data" is exactly _why_ I think nondestructive partition
> resizers are dumb. Given that you've made a safety copy of your data on
> other media, and your confidence that the safety copy is reliable, why
> not just blow away the wrong-sized partition, make replacement ones,
> then copy the safety copy's data back?
>
Because it takes forever to transfer large dollops of data and only a
couple of minutes to resize a partition and make a new one. When I
RSYNCed my primary data partition last month, it took all night and a
big chunk of the next day to transfer over 100 GB. And I forgot to use
a verbose option, so I had to trust it was actually doing something and
hadn't just hung up (well, actually I did check with TOP that most of my
minuscule CPU was being devoted to the task).
-e
More information about the conspire
mailing list