Koozali.org: home of the SME Server

Extra hdd question (yes, I did use search!)

Clint

Extra hdd question (yes, I did use search!)
« on: August 21, 2003, 12:25:05 PM »
Ok, so I installed e-smith 6 beta 3 on my server, and I'm trying to get the following configured:

hde mounted in place of /home/e-smith/files/ibays/isos/ (or whatever the path to the iso ibay is)
hdf mounted in place of /home/e-smith/files/ibays/mp3s/ (or whatever the path to the mp3 ibay is)

I would like both in ext3 format, and to automount to the system each time it boots.

Can anyone give me step-by-step (the *exact* commands to enter, etc.) instructions on how to do this?

Assume the drives are not partitioned/formatted, this is a fresh install, and I have not done anything to the fstab.

I did search and tried following the advice given in other threads, but ended up breaking something and the machine wouldn't boot all that correctly anymore (it gives a few errors and freezes half of the time).

Thank you so much.

Although I am learning, it is a slow process. I should have made a reinstall disc before trying something like this :D

Byte

Re: Extra hdd question (yes, I did use search!)
« Reply #1 on: August 21, 2003, 01:18:41 PM »
OK, so you have now installed or reinstalled SME! Next you want to format both hd's at command type

mkfs -t ext2 /dev/hde

then to convert to ext3 type again at command prompt

tune2fs -j /dev/hde

now do same for other drive.

Then edit the /etc/fstab file and add 2 more lines at bottom of last line...

/dev/hde                /home/e-smith/files/ibays/                  ext3    usrquota,grpquota   1 1

now type mount -a which will mount all drives with any luck your nearly there...

Next you want to create quota's on them so just above the root of your new hds run this command at the prompt...

quotacheck -avug

Should come back OK (will be back at command line if ok)

Now reboot and it should all be mounted when you next log in.

Hope this gives you some guide.

Cheers

Byte

Michiel Blotwijk

Re: Extra hdd question (yes, I did use search!)
« Reply #2 on: August 21, 2003, 02:27:55 PM »
Shouldn't we first partition the disk?
fdisk /dev/hde
and when prompted:
n
p
1
(accept the suggested first&last cylinders)
w

> OK, so you have now installed or reinstalled SME! Next you
> want to format both hd's at command type
>
> mkfs -t ext2 /dev/hde

mkfs -t ext2 /dev/hde1 (or whatever number you gave the partiton in fdisk)

>
> then to convert to ext3 type again at command prompt
>
> tune2fs -j /dev/hde

tune2fs -j /dev/hde1

> Then edit the /etc/fstab file and add 2 more lines at bottom
> of last line...
>
> /dev/hde              
> /home/e-smith/files/ibays/                  ext3  
> usrquota,grpquota   1 1

/dev/hde1      /home/e-smith/files/ibays/        ext3   usrquota,grpquota   1 1

> now type mount -a which will mount all drives with any luck

Didn't know that option. Works indeed :-)

> your nearly there...
>
> Next you want to create quota's on them so just above the
> root of your new hds run this command at the prompt...
>
> quotacheck -avug
>
> Should come back OK (will be back at command line if ok)
>
> Now reboot and it should all be mounted when you next log in.

I don't think rebooting is really needed here. That's more of a Microsoft-thing :-)

This question has come up several times, so maybe we should put it up on contribs.org as a how-to?

Michiel

Byte

Re: Extra hdd question (yes, I did use search!)
« Reply #3 on: August 21, 2003, 02:38:07 PM »
Oops assumed it would already been fdisked, thanks Michiel for pointing out.

How-to would be good for newbies, if i can help let me know been using SME (e-smith) since the very first time it came out (think we were there number 3 customer when we brought support from them along time ago.

Byte

Michiel Blotwijk

Re: Extra hdd question (yes, I did use search!)
« Reply #4 on: August 21, 2003, 05:11:08 PM »

Byte

Re: Extra hdd question (yes, I did use search!)
« Reply #5 on: August 21, 2003, 07:57:53 PM »
Might be good to add a SCSI table at top, I use SCSI :-)

 
 IDE controller   Device name
 Master 1          /dev/sda
 Slave 1            /dev/sdb
 Master 2         /dev/sdc
 Slave 2          /dev/sdd
 
Just my thoughts

Kind Regards

Byte

Byte

Re: Extra hdd question (yes, I did use search!)
« Reply #6 on: August 21, 2003, 08:01:12 PM »
oops, also step 5 should be...

quotacheck -avug /dev/hdc

and you might want to change step 4 the bit where you type df how about df -T that will show your drive even having EXT3 as well :-)

Just another few things that I thought might be useful

Byte

Clint

Re: Extra hdd question (yes, I did use search!)
« Reply #7 on: August 21, 2003, 10:09:19 PM »
Wow, wow, wow. Thanks so much guys! I never expected such a large responce from the comunity!

I still have to reinstall e-smith, but as soon as I get it finished (installing while I type), I will try all your suggestions :D

Thanks again!

Clint

Re: Extra hdd question (yes, I did use search!)
« Reply #8 on: August 21, 2003, 11:18:06 PM »
Ok, so I followed the instructions for both drives, and when I go to mount, I get the error: "wrong fs type, bad option, bad superblock on /dev/hde1, or too many mounted file systems"

Same for /dev/hdf1 :(

What am I doing wrong?

Again, thanks for the help.

Clint

Re: Extra hdd question (yes, I did use search!)
« Reply #9 on: August 21, 2003, 11:29:36 PM »
Oops, never mind. Figured it out, I was formating the hdds all screwy...

Works great, thanks guys!

Michiel Blotwijk

Re: Extra hdd question (yes, I did use search!)
« Reply #10 on: August 22, 2003, 12:00:15 AM »
Did fdisk, mkfs or tune2fs return any errors?

Try fdisk /dev/hde and hit p to get an overview of the partitions and their type.

BTW, how come you mount them to /dev/hde? Most motherboards I know of only have two IDE controllers, i.e. /dev/hda through /dev/hdd. Are you misusing the IDE controllers of some RAID-board? That might explain the "too many mounted file systems" message.

Michiel

Clint

Re: Extra hdd question (yes, I did use search!)
« Reply #11 on: August 22, 2003, 12:06:44 AM »
I formatted the hdds wrong, I formatted with ext3 the first command (which didn't work too well), and that is what was causing the errors.

I'm using a promise ata-133 drive controller that came with a hard drive I purchaced recently. It is just a device controller, and doesn't do RAID or anything special (bty, they make great ata-133 controllers under most any os, Maxtor is selling them with their 160+ drives). It uses hde, hdf, hdg, and hdh normaly (according to the website).

It doesn't pop up any errors now, and I'm testing to see if the full capasity is avalible by copying every Linux ISO I have to the ibays the drives are mounted in.

Thanks so much, I couldn't have done it without you guys.

Michiel Blotwijk

Re: Extra hdd question (yes, I did use search!)
« Reply #12 on: August 22, 2003, 12:06:50 AM »
Byte,

I incorporated your comments except for this one:

> quotacheck -avug /dev/hdc

That will check also the quota on /, resulting in the following error message:

[root@perkamentus root]# quotacheck -avug
quotacheck: Quota for users is enabled on mountpoint / so quotacheck might damage the file.
Please turn quotas off or use -f to force checking.

Michiel

Byte

Re: Extra hdd question (yes, I did use search!)
« Reply #13 on: August 22, 2003, 12:19:19 AM »
The way you done the quota check you are checking the root / HD you need to go into the directory you created ie

cd /home/e-smith/files/ibay/

now your in the folder which is the root of that path (hope you know what I mean)

then if you run that quotacheck -auvg command it will run corretly, if you dont then you are likey to have quota problems for that hd


Please let me know if you have any problems

Cheers

Byte

Tom Keiser

Re: Extra hdd question (yes, I did use search!)
« Reply #14 on: August 28, 2003, 08:09:36 AM »
Michiel:

   Your how-to is great, but I have a (dumb) question.  You suggest mounting the new drive at /mnt/bigdrive, copying the contents of /home to the new drive, and then remove the contents of the original /home directory.

   Once the new drive is later mounted at /home, the original drive and its data in the /home directory should never interfere with the data on the new drive. (Not in my experience, anyway). So is it really necessary to rm the /home directory on the original drive?  I see that original drive as a kind of a backup of the settings, and don't copy to the newdrive until all the ibays and users, etc., are configured. If there is a risk involved in doing this, I've been blessedly spared from it.

   BTW, I like to use /home/e-smith/files/ as a mount point.

Regards,

Tom

Michiel Blotwijk

Re: Extra hdd question (yes, I did use search!)
« Reply #15 on: August 28, 2003, 01:06:43 PM »
> experience, anyway). So is it really necessary to rm the
> /home directory on the original drive? I see that original
> drive as a kind of a backup of the settings, and don't copy

That's the beauty of Linux. There are 10^6 ways of doing the same thing :-)

However, personally I think your approach can be confusing and dangerous. Once you mount the new drive to /home, the original content of that directory will be "hidden" behind the content of your new disk. But it will be hard to know for sure. Are you really looking at the new /home, or is it still the old one because the drive didn't mount for whatever reason?

If you diligently do a backup/copy/diff before deleting, the chances of doing something irrevocable are close to zero. But then again, paranoia is a virtue :-)

Besides, most people add a new hard disk only when they need more disk space. Leaving all the stuff on the disk as a kind of backup, beats this purpose.


>    BTW, I like to use /home/e-smith/files/ as a mount point.
Very valid point (in fact that's what I also do :D) I'll add your recomendation to the howto.

Thanks for the feed back
Michiel

Tom Keiser

Re: Extra hdd question (yes, I did use search!)
« Reply #16 on: August 28, 2003, 05:35:46 PM »
Michiel Blotwijk wrote:
>
> > experience, anyway). So is it really necessary to rm the
> > /home directory on the original drive? I see that original
> > drive as a kind of a backup of the settings, and don't copy
>
> However, personally I think your approach can be confusing
> and dangerous. Once you mount the new drive to /home, the
> original content of that directory will be "hidden" behind
> the content of your new disk. But it will be hard to know for
> sure. Are you really looking at the new /home, or is it still
> the old one because the drive didn't mount for whatever reason?

No matter which mount point you use, if there's no content in your ibays, your big new drive didn't mount, so there's no chance for confusion.

Tom

Charlie Brady

Re: Extra hdd question (yes, I did use search!)
« Reply #17 on: August 29, 2003, 07:13:51 PM »
Michiel Blotwijk wrote:

> BTW, how come you mount them to /dev/hde? Most motherboards I
> know of only have two IDE controllers, i.e. /dev/hda through
> /dev/hdd. Are you misusing the IDE controllers of some
> RAID-board?

Not misusing, using. FasTrak Lite M/B RAID controllers sometimes (always?) show up as /dev/hde and /dev/hdg and work fine.

> That might explain the "too many mounted file
> systems" message.

I suspect the problem is with duplicate partition labels.

Charlie

Charlie Brady

Re: Extra hdd question (yes, I did use search!)
« Reply #18 on: August 29, 2003, 07:15:40 PM »
Charlie Brady wrote:
 
> > That might explain the "too many mounted file
> > systems" message.
>
> I suspect the problem is with duplicate partition labels.

Cancel that, I see that a better answer has already been discovered.

Charlie

Arjay

Re: Extra hdd question (yes, I did use search!)
« Reply #19 on: August 29, 2003, 07:37:06 PM »
Michiel Blotwijk wrote:
>
> http://mirror.contribs.org/smeserver/contribs/mblotwijk/HowToGuides/AddExtraHardDisk.htm
>
> As allways, comments are apreciated.
> Michiel

Step 2: Partition the disk
-==========================
[root@Cs2MainServer root]# fdisk /dev/hdc

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-39813, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-39813, default 39813):
Using default value 39813

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

Calling ioctl() to re-read partition table.
Syncing disks.
[root@Cs2MainServer root]#
-==================================================


Step 3: Format the new partition
-==========================================
[root@Cs2MainServer root]# mkfs -t ext2 /dev/hdc1
mke2fs 1.27 (8-Mar-2002)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
2508352 inodes, 5016430 blocks
250821 blocks (5.00%) reserved for the super user
First data block=0
154 block groups
32768 blocks per group, 32768 fragments per group
16288 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
        4096000

Writing inode tables: done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 36 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.[root@Cs2MainServer root]# tune2fs -j /dev/hdc1
tune2fs 1.27 (8-Mar-2002)
Creating journal inode: done
This filesystem will be automatically checked every 36 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
[root@Cs2MainServer root]#
-===============================================


Step 4: Create a mounting point for the new disk
-====================================
[root@Cs2MainServer root]# mkdir /mnt/bigdisk
[root@Cs2MainServer root]#
=====================================


Step 5: Automount at boot time
-======================================
LABEL=/                 /                       ext3    usrquota,grpquota        1 1
LABEL=/boot1            /boot                   ext3    defaults        1 2
none                    /dev/pts                devpts  gid=5,mode=620  0 0
/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/shm                tmpfs   defaults        0 0
/dev/hda2               swap                    swap    defaults        0 0
/dev/hdc1 /mnt/bigdisk ext3 usrquota,grpquota 1,1


[root@Cs2MainServer root]# mount -a
[mntent]: line 19 in /etc/fstab is bad
[root@Cs2MainServer root]#
-============================================

-----> i really followed everything in your howto bro, actually im just copy and pasting it but still i have this: [mntent]: line 19 in /etc/fstab is bad
error that keeps on coming out. what will i do?

Michiel

Re: Extra hdd question (yes, I did use search!)
« Reply #20 on: August 29, 2003, 07:51:57 PM »
> [root@Cs2MainServer root]# mount -a
> [mntent]: line 19 in /etc/fstab is bad

So something is wrong in your /etc/fstab file. Could it be that you modified the file with some Windows text editor?

An other possibility could be that you didn't finish the last line with a new line. Please check and let us know if that didn't help.

Arjay

Re: Extra hdd question (yes, I did use search!)
« Reply #21 on: August 29, 2003, 10:20:50 PM »
Michiel wrote:
>
> > [root@Cs2MainServer root]# mount -a
> > [mntent]: line 19 in /etc/fstab is bad
>
> So something is wrong in your /etc/fstab file. Could it be
> that you modified the file with some Windows text editor?

-------> no other program was used to edit /etc/fstab than pico

 
> An other possibility could be that you didn't finish the last
> line with a new line. Please check and let us know if that
> didn't help.

---> i did a new line. i even tried to add another new line to make sure but that error still comes up. i also tried going throught the whole process while omitting the first step to see if there would be a different output. but sadly, the error on /etc/fstab still comes up

Michiel

Re: Extra hdd question (yes, I did use search!)
« Reply #22 on: August 29, 2003, 11:07:58 PM »
> /dev/hdc1 /mnt/bigdisk ext3 usrquota,grpquota 1,1

Sorry, my error. The correct line should be:

/dev/hdc1 /mnt/bigdisk ext3 usrquota,grpquota 1 2

(note that there should be no comma between the 1 and  2 at the end!)

Arjay

Re: Extra hdd question (yes, I did use search!)
« Reply #23 on: August 29, 2003, 11:14:09 PM »
Michiel wrote:
>
> > /dev/hdc1 /mnt/bigdisk ext3 usrquota,grpquota 1,1
>
> Sorry, my error. The correct line should be:
>
> /dev/hdc1 /mnt/bigdisk ext3 usrquota,grpquota 1 2
>
> (note that there should be no comma between the 1 and  2 at
> the end!)


so in the:
-============================================
Mount the disk to /home/e-smith/files and make it automountable

[root@hogwarts /]# umount

[root@hogwarts /]# pico /etc/fstab

/dev/hdc1 /home/e-smith/files ext3 usrquota,grpquota 1,1
 -==============================================

will it be: /dev/hdc1 /home/e-smith/files ext3 usrquota,grpquota 1 2
--> like the one on top?

or it will be:
/dev/hdc1 /home/e-smith/files ext3 usrquota,grpquota 1 1   ?????

Michiel

Re: Extra hdd question (yes, I did use search!)
« Reply #24 on: August 29, 2003, 11:28:47 PM »
Both will work, but 2 seems to be the recommended value. From man fstab:

The sixth field, (fs_passno), is used by the fsck(8)  pro­
gram to determine the order in which filesystem checks are
done at reboot time.  The root filesystem should be speci­
fied  with  a fs_passno of 1, and other filesystems should
have a fs_passno of 2.  Filesystems within a drive will be
checked  sequentially, but filesystems on different drives
will be checked at the same time  to  utilize  parallelism
available in the hardware.  If the sixth field is not pre­
sent or zero, a value of zero is returned  and  fsck  will
assume that the filesystem does not need to be checked.

Arjay

Re: Extra hdd question (yes, I did use search!)
« Reply #25 on: August 29, 2003, 11:37:50 PM »
thanks bro! great help! its already 3am here but im still not sleeping coz i still cant figure out where i went wrong. luckily youre there to assist. i can now go to sleep.
:-)

Arjay

Re: Extra hdd question (yes, I did use search!)
« Reply #26 on: August 30, 2003, 05:19:40 PM »
Michiel, bro what if i fresh installed a sme5.6 then mounted hdc1 to /home/e-smith/files... the files are there but the box dont recognize the users, groups and owners of the ibays... what will i do? replace the current accounts, configuration, domains, hosts and networks files with the one in my backup? coz i have a problem in my last backup... when i load it up, named daemon wont work well. maybe because im configuring named.conf that time that ive backup the system then my backups before this "shittie" backup were all delete.

what steps will i take?

Kent Budolfsen

Re: Extra hdd question (yes, I did use search!)
« Reply #27 on: September 24, 2003, 11:47:16 PM »
Hi all

Help Please!!

I've tried to mount an xtra harddisk as Michiel wrote in the Howto-guide, and it mounted fine but I couldn't see the xtra GBs.

Then I made a change to the fstab-file and now my SME-server only starts in Read-only-mode.

What do I do...?

The Fstab-file is as follows:

LABEL=/                 /                       ext2    usrquota,grpquota1 1
LABEL=/boot             /boot                   ext2    defaults         1 2
/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/hdc5               swap                    swap    defaults         0 0
/dev/hdd1               /home/e-smith/files     ext2    usrquota,grpquota1 1

Kent

Clint

Re: Extra hdd question (yes, I did use search!)
« Reply #28 on: September 25, 2003, 11:33:29 AM »
Hey, now that I got one server running, I decided to start on getting a general purpose webserver machine up and running, again, with 2 hard disks (gotta use all this space somewhere :D ).

Following the guide on contribs.org, I ran into a slight difficulty.

Since the quotacheck thing throws up an error, and I was too lazy to attempt fixing it, I decided to bypass it entirely, and entered this into my fstab file instead of what the guide suggested:

/dev/hde1 /home/e-smith/files/ ext3 defaults 1,2

Works like a charm, and no error messages. Is there a specific reason you included quotacheck in your guide?

Seems to work well, I'm testing again using the Linux ISO method. While not scientific, it does ensure that it isn't copying to my little 9gb hdd :D

Michiel

Re: Extra hdd question (yes, I did use search!)
« Reply #29 on: September 25, 2003, 11:55:25 AM »
> specific reason you included quotacheck in your guide?

quotacheck is entirely optional, but if your users find out there are no quota on that disk, 9GB might not be enoug to store all their MP3's :-)

> /dev/hde1 /home/e-smith/files/ ext3 defaults 1,2

The comma at the end shouldn't be there.

Just out of curiosity, what error did you get from quotacheck?

Michiel

Clint

Re: Extra hdd question (yes, I did use search!)
« Reply #30 on: September 25, 2003, 11:58:23 AM »
Oops, yeah that comma shouldn't be there. It isn't in the fstab file ;)

The error was something like "couldn't find quotafile on /dev/hde1/" or something, the error repeated twice when I entered it, and twice each boot...

So quotacheck just allows the server to tell windows how much space is left? (just curious)

Michiel

Re: Extra hdd question (yes, I did use search!)
« Reply #31 on: September 25, 2003, 12:01:09 PM »
> I've tried to mount an xtra harddisk as Michiel wrote in the
> Howto-guide, and it mounted fine but I couldn't see the xtra
> GBs.

type "fdisk /dev/hdd" and then press "p" to get your partition table. Does that match the capacity and geometry of your harddisk?

Michiel

Re: Extra hdd question (yes, I did use search!)
« Reply #32 on: September 25, 2003, 12:08:48 PM »
> The error was something like "couldn't find quotafile on
> /dev/hde1/" or something, the error repeated twice when I
> entered it, and twice each boot...
>

I guess you didn't assign any user quota in the server-manager.

> So quotacheck just allows the server to tell windows how much
> space is left? (just curious)

Quota will allow you to limit the disk space individual users can use on your system. Assign a quotum of 500MB to user clint and you won't be able to store more than that on your big disk.

Clint

Re: Extra hdd question (yes, I did use search!)
« Reply #33 on: September 25, 2003, 12:13:27 PM »
Ok, thanks. I have no need for quota then. It is mostly me loading up the fileserver, most everyone else will just be reading files off it/doing minor additions.

Thanks again, that guide has been very helpful! I did get all 9.5gb of Linux distros copied over to the server, so that must mean that it isn't using the 9.1gb drive for my file storage :D

Now, to get the users to actualy use the server...

Offline elorenz

  • ***
  • 41
  • +0/-0
Re: Extra hdd question (yes, I did use search!)
« Reply #34 on: February 01, 2004, 03:32:07 PM »
> The error was something like "couldn't find quotafile on /dev/hde1/" or something, the error repeated twice when I entered it, and twice each boot...

You have to run quotacheck with the -c option to create the quota files on the new fs.
This finally worked for me, I got the quotas working on the new hard drive and corresp. mount point.

Regards
............