Koozali.org: home of the SME Server

Looking for a simple way 2 set up second HD

Irhineha

Looking for a simple way 2 set up second HD
« on: August 25, 2002, 06:40:49 AM »
Greetings,

I did a search on this and came up with this http://forums.contribs.org/index.php?topic=5203.msg18384#msg18384.  I followed all the steps in this up to the fdisk portion when I did this I had an old windows base drive in the machine for I figured I would blow away the old partioning a make one big new one.  The I went to write and exit and It told me I had to reboot becuase drive was busy so It could not make changes.  I rebooted and =during boot up it came up with an error and froze the boot saying that it had a problem with this.  I could not figure out a way to recover it.  So I had to lose everything and reformat reinstall.  Now my partitioning looks like below what do I need to do and please go step by step.

HDB:
Disk /dev/hdb: 255 heads, 63 sectors, 1245 cylinders
Units = cylinders of 16065 * 512 bytes

   Device Boot    Start       End    Blocks   Id  System
/dev/hdb1   *         1        33    265041   82  Linux swap
/dev/hdb2            34      1245   9735390   83  Linux


HDA:
Disk /dev/hda: 255 heads, 63 sectors, 787 cylinders
Units = cylinders of 16065 * 512 bytes

   Device Boot    Start       End    Blocks   Id  System
/dev/hda1   *         1         2     16033+  83  Linux

NOw to me they both say linuxs and should be ready to use be when I run the command:
mke2fs /dev/hdb1(since this is the next step listed) I recieve this error:

mke2fs 1.26 (3-Feb-2002)
/dev/hdb1 is mounted; will not make a filesystem here!

Can some one please walk me through this.  I am feeling kinda lost.

Irhineha

Re: Looking for a simple way 2 set up second HD
« Reply #1 on: August 25, 2002, 06:44:58 AM »
Also forgot to add I just did a df -h and got this not I am reallt confused:

[root@Big-John root]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/hdb2             9.1G  5.9G  2.7G  68% /
/dev/hda1              15M  2.6M   11M  19% /boot

HDA is a 6 gig drive what happened to the rest of it???

Irhineha

Re: Looking for a simple way 2 set up second HD
« Reply #2 on: August 25, 2002, 06:51:59 AM »
I just tried to make a partition on hda with the rest of the size on drive and this is everything I did this is the same message I got before when the computer crashed after reboot so I have not rebooted for that reason.

[root@Big-John root]# fdisk /dev//hda

Command (m for help): p

Disk /dev//hda: 255 heads, 63 sectors, 787 cylinders
Units = cylinders of 16065 * 512 bytes

    Device Boot    Start       End    Blocks   Id  System
/dev//hda1   *         1         2     16033+  83  Linux

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): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (3-787, default 3): 3
Last cylinder or +size or +sizeM or +sizeK (3-787, default 787): 787

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Re-read table failed with error 16: Device or resource busy.
Reboot your system to ensure the partition table is updated.

WARNING: If you have created or modified any DOS 6.x
partitions, please see the fdisk manual page for additional
information.
Syncing disks.

Is this what I should be doing or if now how can I back it out and do it the rightway?

Irhineha

Re: Looking for a simple way 2 set up second HD
« Reply #3 on: August 25, 2002, 07:54:24 AM »
Alright I did reboot and everything came back up but now that you have see what I have done what do I do now.

Kees Blokland

Re: Looking for a simple way 2 set up second HD
« Reply #4 on: August 25, 2002, 02:33:42 PM »
My suggestion: start from scratch with ONE disk & install e-smith so it works.
than follow this:

You have to understand, that once you mount disks, you can not do things to them anymore. Your should ONLY mount them via fstab, once everything is working properly. You mount them by hand from the command line, until you are sattisfied that they do as you want them to do. This way, if you make a mistake, all you have to do is reboot and you are back to a single disk and a working system!

example: 'mount /dev/hdd1  /home/e-smith/files/users'   will mount this drive as /home/e-smith/files/users..

There are options to mount, usually it will come up with an educated guess, but I suggest you read the mount document.

unmount it again with 'umount' (read the doc for this as well)    



This is an old story I use myself:

HOWTO add more diskspace to a e-smith server
Reason: because I have loads of small drives..
I wanted to add extra storage for ibays and users.

The directory structure is as follows:

/home/e-smith/files/ibays
/home/e-smith/files/users

The main system lives on a 2 G harddisk. (Install e-smith on this disk first.)
to add disks:  ( from: www.linuxnewbie.org/nhf/intel/hardware/hd_add.html)
connect the disk(s) to you motherboard and look at 'dmesg |more'
see what the new disks are called.

mine were:

/dev/hdc and /dev/hdd

You need to partition them. I choose a single partition per disk.

fdisk /dev/hdb    20G
fdisk /dev/hdc     ( have a look at the above link for more details)
fdisk /dev/hdd

Delete old stuff if needed and create the partition with 'n', make it a primary (1)
don't forget to write it to the disk!   (m for Help)

mkfs /dev/hdb1
mkfs /dev/hdc1
mkfs /dev/hdd1

make some directories under the / . I made 'ibays' and 'users'

mkdir users
mkdir ibays

copy the contents (should not be much) from  /home/e-smith/files/ibays/
to /ibays/
(use 'mc' for this, it's easy to use)

same for users..  ( you end up with  /home/e-smith/files/ibays/ibays, but
you have to keep the stuff in the original ibays somewhere, you can't (want)
keep the stuff in root.. think about it for a while..)

now use vi (or pico) to edit /etc/fstab

my fstab now looked like this

LABEL=/               /            ext2          defaults 1 1
LABEL=/boot         /boot     ext2    defaults  1 2
/dev/hdb1            /home/e-smith/files/users/myname    ext2  defaults  1 1
/dev/hdc1            /home/e-smith/files/ibays ext2    defaults 1 1
/dev/hdd1               /home/e-smith/files/users ext2    defaults 1 1
/dev/cdrom             /mnt/cdrom       iso9660 noauto,owner,ro 0 0
/dev/fd0                  /mnt/floppy       auto noauto,owner    0 0
none                      /proc                proc defaults        0 0
none                      /dev/pts            devpts gid=5,mode=620  0 0
/dev/hda5               swap                swap    defaults  0 0


do a:  mount -a

and bingo.. all is well.
manually copy the files in ibays to the right place.
now create users, ibays etc..