Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Adding hard disk
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
peter121
n00b
n00b


Joined: 27 Apr 2005
Posts: 9

PostPosted: Fri Apr 29, 2005 11:45 pm    Post subject: Adding hard disk Reply with quote

Ive just purchased a new 120gb disk that I plan on using as a place for /home

So far I have,

fitted the disk
created the partition
created a file system (mke2fs /dev/hdd)


Now Im confused as to what else I need to do before I can use home on /dev/hdd instead of /dev/hda3
Back to top
View user's profile Send private message
Tyir
Apprentice
Apprentice


Joined: 08 Mar 2004
Posts: 172
Location: Montreal

PostPosted: Sat Apr 30, 2005 12:05 am    Post subject: Reply with quote

this is what you do:

umount /mnt/home (unmount it)
then edit /etc/fstab

put in
Code:

/dev/hdd       /home     ext2        noatime 0 0

Remove the /dev/hda3 entry
but the way, did you want to journal it, so it was ext3? You should..

Anyway, then you can just do mount /mnt/home
_________________
There are two things I have learnt in life:
1. Don't reveal everything you know.
Back to top
View user's profile Send private message
peter121
n00b
n00b


Joined: 27 Apr 2005
Posts: 9

PostPosted: Sat Apr 30, 2005 12:14 am    Post subject: Reply with quote

Code:
# /etc/fstab: static file system information.

# noatime turns off atimes for increased performance (atimes normally aren't
# needed; notail increases performance of ReiserFS (at the expense of storage
# efficiency).  It's safe to drop the noatime options if you want and to
# switch between notail and tail freely.

# <fs>                  <mountpoint>    <type>          <opts>                  <dump/pass>
/dev/hda1               /boot           ext2            defaults,noatime        1 2
/dev/hda2               none            swap            sw                      0 0
/dev/hda3               /               ext3            noatime                 0 1

none                    /proc           proc            defaults                0 0
none                    /dev/shm        tmpfs           nodev,nosuid,noexec     0 0

/dev/cdrom              /mnt/cdrom      auto            noauto,user             0 0


If I remove /dev/hda3 from /etc/fstab will my system still boot as I have all the major files there...?

Would you say something like this would work? I would obviously have to rename /home on hda3 to something like home_backup to prevent any problems..

Code:

# /etc/fstab: static file system information.

# noatime turns off atimes for increased performance (atimes normally aren't
# needed; notail increases performance of ReiserFS (at the expense of storage
# efficiency).  It's safe to drop the noatime options if you want and to
# switch between notail and tail freely.

# <fs>                  <mountpoint>    <type>          <opts>                  <dump/pass>
/dev/hda1               /boot           ext2            defaults,noatime        1 2
/dev/hda2               none            swap            sw                      0 0
/dev/hda3               /               ext3            noatime                 0 1

/dev/hdd                /home           ext2            noatime                 0 1

none                    /proc           proc            defaults                0 0
none                    /dev/shm        tmpfs           nodev,nosuid,noexec     0 0

/dev/cdrom              /mnt/cdrom      auto            noauto,user             0 0

Back to top
View user's profile Send private message
Tyir
Apprentice
Apprentice


Joined: 08 Mar 2004
Posts: 172
Location: Montreal

PostPosted: Sat Apr 30, 2005 7:30 pm    Post subject: Reply with quote

Yep, thats exactly what you want.
And move the copied files over after you boot.
_________________
There are two things I have learnt in life:
1. Don't reveal everything you know.
Back to top
View user's profile Send private message
Gentree
Watchman
Watchman


Joined: 01 Jul 2003
Posts: 5350
Location: France, Old Europe

PostPosted: Sun May 01, 2005 12:43 am    Post subject: Reply with quote

tyr , please dont post "help" if you do not really know yourself, even if meant well is worse than no help.
Quote:
/dev/hdd /home ext2 noatime 0 0

/dev/hdd is the disk, starting at the mbr , it does not refer to his partition.

Quote:
umount /mnt/home

who said anything about /mnt/home ?

Quote:
Remove the /dev/hda3 entry

why are you telling him to remove his root partition from fstab ?? :roll:


@peter121

It seems you are pretty confused about you want to do here.

Accepting that you have a good reason form making your new disk into one huge partition and using that for /home , why are you messing with / ?

You say you made a partition, with which program? /dev/hdd is a disk not a partition . If you did mkfs /dev/hdd afterwards you just blew away the partition table! It should have been /dev/hdd1 I imagine.


For what you describe:

use parted or cfdisk of similar to create your partition.
You will need to reboot to see this partition appear as /dev/hdd1

fomat a partition to be used as /home.
You should use a journalling fs like ext3 or reiserfs rather than ext2 , they are more reliable.

mkfs.ext3 /dev/hdd1

mount -t ext3 /dev/hdd1 /home_tmp
cp -a /home/* /home_tmp

cd /
umount /home_tmp
mount -t ext3 /dev/hdd1 /home

you can now enjoy your new home
now add hdd1 to /etc/fstab
do _not_ remove hda3
no need to reboot .


Finally , unless you really need 120G of /home I suggest a smaller partition , you will probably find better uses for the rest of that disk.

HTH 8)
_________________
Linux, because I'd rather own a free OS than steal one that's not worth paying for.
Gentoo because I'm a masochist
AthlonXP-M on A7N8X. Portage ~x86


Last edited by Gentree on Sun May 01, 2005 10:35 pm; edited 1 time in total
Back to top
View user's profile Send private message
Tyir
Apprentice
Apprentice


Joined: 08 Mar 2004
Posts: 172
Location: Montreal

PostPosted: Sun May 01, 2005 6:43 pm    Post subject: Reply with quote

Blah, he's totally right, I knew what to do, but I didn't write what I meant to write.

Of course you have to partition it first, and I for some reason I understood he already had a seperate partition for home.

Sorry!
_________________
There are two things I have learnt in life:
1. Don't reveal everything you know.
Back to top
View user's profile Send private message
Gentree
Watchman
Watchman


Joined: 01 Jul 2003
Posts: 5350
Location: France, Old Europe

PostPosted: Sun May 01, 2005 9:56 pm    Post subject: Reply with quote

There are two things I have learnt in life:

2. Mix it around to confuse the oppostion :wink:
_________________
Linux, because I'd rather own a free OS than steal one that's not worth paying for.
Gentoo because I'm a masochist
AthlonXP-M on A7N8X. Portage ~x86
Back to top
View user's profile Send private message
kar1107
n00b
n00b


Joined: 30 Apr 2005
Posts: 16
Location: Bay area, California

PostPosted: Sun May 01, 2005 10:08 pm    Post subject: Reply with quote

Adding Gentree's excellent explanation....

First the OP doesn't seem to have a separate /home partition. He wan't to create a new partitiion now.
So he may not be able to do...

umount /home

I think after cp -a /home/* /dev/hdd1,

cd /
mount -t ext3 /dev/hdd1 /home.

We'll see the new /home; but the old home is still lurking underneath. If he wants to reclaim the disk
space, the only way I can think of is... do a \rm -rf /home/* (that ought to be done carefully though :wink: ),
after the copy. Another safe way is to login from a liveCD or another disk (if linux is available) and do
the cleanup and reclaim the diskspace under /home
Back to top
View user's profile Send private message
Gentree
Watchman
Watchman


Joined: 01 Jul 2003
Posts: 5350
Location: France, Old Europe

PostPosted: Sun May 01, 2005 10:33 pm    Post subject: Reply with quote

Quote:
Now Im confused as to what else I need to do before I can use home on /dev/hdd instead of /dev/hda3


Since he is obviously still learning (as we all are) I would recommend leaving the contents of /home on /dev/hda3 hidden and untouched for a while incase he does something silly like formatting the disk instead of the partition. wink:

I have corrected the post. What I meant was
Code:
umount /home_tmp


umount /home would have given an error , so I guess he has not read the post yet.

You are indeed quite correct about recovering the disk space, thanks for picking up my error. 8)
_________________
Linux, because I'd rather own a free OS than steal one that's not worth paying for.
Gentoo because I'm a masochist
AthlonXP-M on A7N8X. Portage ~x86
Back to top
View user's profile Send private message
peter121
n00b
n00b


Joined: 27 Apr 2005
Posts: 9

PostPosted: Tue May 03, 2005 4:00 pm    Post subject: Reply with quote

Thanks for your help,

I have the new drive working fine, the filesystem is however ext2, is it safe to upgrade to ext3 with data on the disk?

Quote:

You say you made a partition, with which program? /dev/hdd is a disk not a partition . If you did mkfs /dev/hdd afterwards you just blew away the partition table! It should have been /dev/hdd1 I imagine.


/dev/hdd is the 120gb disk, I dont have /dev/hdd1
Back to top
View user's profile Send private message
Gentree
Watchman
Watchman


Joined: 01 Jul 2003
Posts: 5350
Location: France, Old Europe

PostPosted: Tue May 03, 2005 5:53 pm    Post subject: Reply with quote

Not that I know of , but I never had the need for ext2, it's older than the ark.

Well I did suggest not using it as one huge partition , now you see one reason why.

If you have followed my other suggestion above you will still have a copy of your old content on the original drive. Just umount /dev/hdd and you will see it again. (How did I know you were going to need it ?)

Once you get out of that one I would suggest using a few gigs of all that lovely space to clone your root partition. Even if you do nothing daft (and we all do) portage will sooner or later. If you have a nice clean working system make a snap-shot of it and add it to your grub.conf so next time you cant boot you have a fall-back system .

This will save you days of work sometime soon.

8)
_________________
Linux, because I'd rather own a free OS than steal one that's not worth paying for.
Gentoo because I'm a masochist
AthlonXP-M on A7N8X. Portage ~x86
Back to top
View user's profile Send private message
macawgumbo
Apprentice
Apprentice


Joined: 28 May 2004
Posts: 165

PostPosted: Tue May 03, 2005 5:57 pm    Post subject: Reply with quote

You should use reiserfs as it is stable and faster than ext3. You should try reiserfs4 which is the fastest filesystem especially since it is stable now, and you don't have to reinstall because it isn't your root partition.
Back to top
View user's profile Send private message
Gentree
Watchman
Watchman


Joined: 01 Jul 2003
Posts: 5350
Location: France, Old Europe

PostPosted: Tue May 03, 2005 6:44 pm    Post subject: Reply with quote

Quote:
You should use reiserfs as it is stable and faster than ext3
Oh yeah, can you back that up . It's the complete opposite to all the data I have seen. (Speed not stablility wise I mean.)

Less of the "you should" until you do your homework. I prefer "you could try".

I was not going to complicate the thread with fs args but since you brought it up:

I am a fan of Reiser4 which is sometimes faster that ext3 depending on what you are doing with it.

I use it for portage mainly. I recently copied my whole portage tree back and forth quite a bit and got noticably faster times from R4. For other situations it can be a bit slower.

There are constant flame wars about R4 and some devs will spit on your grave for just daring to name it.

Seriously some ppl have had problems on intel HT and multi-processor systems it seems.
Although most of that is fixed I beleive.

I use it on athlon-xp and it has worked beautifully for over a year.

Stick to ext3 until you get things sorted out. Since you will have broken up your 120G by then just make an R4 partition , dupe a partition and remount the new copy and see if works for you.
_________________
Linux, because I'd rather own a free OS than steal one that's not worth paying for.
Gentoo because I'm a masochist
AthlonXP-M on A7N8X. Portage ~x86
Back to top
View user's profile Send private message
peter121
n00b
n00b


Joined: 27 Apr 2005
Posts: 9

PostPosted: Tue May 03, 2005 7:31 pm    Post subject: Reply with quote

I Have just under 80gb free on my root drive,

The purpose of the 120gb drive is for movies, music and genreally all my work.

I did create a backup, so ill upgrade the disk and then revert to the backup if things go wrong
Back to top
View user's profile Send private message
Gentree
Watchman
Watchman


Joined: 01 Jul 2003
Posts: 5350
Location: France, Old Europe

PostPosted: Tue May 03, 2005 8:40 pm    Post subject: Reply with quote

There's lots of reasons for using smaller partitions even if you are doing space hungry work like video.

Imagine a power-out or hardware error corrupts you fs. Would you rather lose 20G or 120G?

Dont forget that with Linux you can just mount each partition anywhere in the tree. So you really dont notice once you have mounted the partitions from fstab at boot.

Creating a couple primary partitions then an extended one to fill the rest of the disk will leave you much more flexibility to organise your disk later. If you dont do that now then you're going to need to borrow another 120G drive later if you want to break things up a bit.

Anyway , glad you got everthing working with the new drive. Glad I could help.

You may later like to look into xfs which is reckoned to be very fast for handling "a few v.large files " type situation.

8)

macawgumbo wrote:
**The man with one ball uses Linux, the man with both uses Gentoo. Who do you think performs better?**
Yeah? and which OS do eunuques use then?
_________________
Linux, because I'd rather own a free OS than steal one that's not worth paying for.
Gentoo because I'm a masochist
AthlonXP-M on A7N8X. Portage ~x86
Back to top
View user's profile Send private message
omnicloud
Guru
Guru


Joined: 10 Mar 2005
Posts: 550
Location: California

PostPosted: Tue May 03, 2005 9:32 pm    Post subject: Reply with quote

Windows of course >_>
Back to top
View user's profile Send private message
Gentree
Watchman
Watchman


Joined: 01 Jul 2003
Posts: 5350
Location: France, Old Europe

PostPosted: Tue May 03, 2005 10:40 pm    Post subject: Reply with quote

Doh, the winning answer is : eunix ! :roll:
_________________
Linux, because I'd rather own a free OS than steal one that's not worth paying for.
Gentoo because I'm a masochist
AthlonXP-M on A7N8X. Portage ~x86
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum