[techtalk] second hard disk

Conor Daly conor.daly at oceanfree.net
Thu Aug 31 01:54:28 EST 2000


On Wed, Aug 30, 2000 at 06:23:27PM +0200 or so it is rumoured hereabouts, 
Helena Verrill thought:
> 
> I wonder if anyone can suggest how best to set up my
> second hard disk.
> The first one is about 2Gb and is pretty much full.
> So, I bought a new 20Gb hard disk.
> My first idea was that I'd just use it for storage, though I
> don't know if this is the best thing or not.

With a 2Gb disk originally, I'm assuming you have about 1.2Gb for Windows
and 800Mb for Linux.  Easiest option is probably to keep this as your boot
/ system drive and to extend onto your 20Gb drive.  
 
> I first formatted and partitioned it under windows,
> and then reformatted it under linux, without repartitioning.
> This was OK.  

Usually the best method...

> But, later I resized the partitions including
> the one I'd left as fat, and now windows can't read any of
> it, and the windows utility for dealing with disk partioning&
> formatting will only offer to reformat the whole thing, and
> remove all the data, and now I've collected more data I've
> just been dumping on the new disk (while using linux), and
> I don't really want to have to move it all and move it back
> after reformatting etc with windows and linux again...
> is there any way round this?

If you delete the FAT partition using linux fdisk, boot windows and try to
create the partition again using Windows fdisk.  This should work so long
as it's the first primary partition you're trying to create.

> Also, I've just been using the new disk for storage, but,
> I wondered, would there be any advantage of changing it to
> the boot disk?  I want to upgrade from linux (red hat) 5.2 to
> 6.2.something.

To extend your linux real estate is quite easy since, unlike Windows, linux 
filesystems can be spread over as many disks as you like.  First of all, I
would move /home to the new disk, If you want to free up even more space
on the old drive, you could move /usr.  My home server's disk useage looks
like this:
5.1M	/bin
2.8M	/boot
112k	/dev
4.8M	/etc
2.6G	/home
21M	/lib
16k	/lost+found
12k	/mnt
4.0k	/opt
0	/proc
5.5M	/root
3.8M	/sbin
96k	/tmp
1.1G	/usr
76M	/var
------------
3.8G	/

Note that /home and /usr between them use 3.7Gb of the total useage of
3.8Gb.  To do this, you need to first, make the new partition(s) on the
20Gb drive, mount them at a temporary mount point, copy the contents of
/home or /usr over, unmount the new partitions, delete the contents of the
*old* /home or /usr, mount the new partitions under /home and update your
/etc/fstab.
 
We'll take /home as an example.

Use fdisk to make a new partition on /dev/hdb for /home (we'll assume this
turns out to be /dev/hdb5)
do a mke2fs on /dev/hdb5
mount /dev/hdb5 on /mnt
do a 

cp -dpR /home /mnt

browse /mnt to make sure you got everything.
umount /mnt
mount /dev/hdb5 /home
browse /home
umount /home
cd /home

# The following step can wait until you're happy that everything has been
copied ok.  Just remember to unmount the *new* /home before deleting the 
*old* /home.  Note that you need the /home directory to exist in the old
drive so that you can mount the new version under it.

rm -rf *	#DANGER, RECURSIVELY DELETING THE ENITRE DIRECTORY
		#CONTENTS!
mount /dev/hdb5 /home
edit /etc/fstab and add the following line

/dev/hdb5             /home                   ext2    defaults        1 2

That's it...  You've now moved /home to the new bigger drive and are ready
to try again with /usr.

have a read of the partitioning howto for more advice.

> Given that I have so little space left on the old disk, is
> this going to be possible there - maybe it will be difficult
> to have enough space for the new and old kernels on the first
> disk... 
> (If I get a new kernel, then it might not be so important to
> have any extra space for windows, since various hardware will
> be supported by linux, and I wont need to use windows (at least
> for the moment).)

For Windows, You can do much the same but in this case you need to have
stuff live on drive D: instead of drive C:.  I have all of my applications
on drive D:, My Docs on E: and *only* the Windows system files on C:.  I
can send you a brief doc on partition layout for dual-boot systems if
you're interested.  

-- 
Conor Daly <conor.daly at oceanfree.net>

Domestic Sysadmin :-)





More information about the Techtalk mailing list