I've got a 80 gb hard drive in my server, and I'm running out of space. Also, my brother needs to back up his hard drive, so I want to add the 40gb hard drive I have. I need someone to hold my hand through it. First, I'm gonna set the jumpers to slave and install it. Then what? Do I need to hook up a monitor and keyboard and get into bios to make sure it's set properly? And then how will I format it to ext3 with fdisk? And then... how do I mount it? And then how can I mount it? Should I mount it to /home/maccabee2 or something? and then how do I edit the fstab file to automatically mount it on boot?
tldr: adding a slave drive in command line linux.
Fdisk:
[code]
fdisk /dev/sdb
n
1
*enter*
*enter*
w
[/code]fdisk is an interactive program with it's own prompt. When you press n at the prompt it tells it to create a new partition. The 1 is for partition 1. The two enters will select the default values for how big to make the partition (assuming you want to fill the whole drive). w writes the new layout to the drive and exits.
I'm assuming the new drive is /dev/sdb, it may be different.
Now to partition it with ext3:
[code]
mke2fs -j /dev/sdb1
[/code]Mounting:
[code]
mount /dev/sdb1 /path/to/anywhere
[/code]Add a line to /etc/fstab
[code]
/dev/sdb1 /mount/path ext3 noatime 0 1
[/code]
[QUOTE=PvtCupcakes;21179495]Fdisk:
[code]
fdisk /dev/sdb
n
1
*enter*
*enter*
w
[/code]fdisk is an interactive program with it's own prompt. When you press n at the prompt it tells it to create a new partition. The 1 is for partition 1. The two enters will select the default values for how big to make the partition (assuming you want to fill the whole drive). w writes the new layout to the drive and exits.
I'm assuming the new drive is /dev/sdb, it may be different.
Now to partition it with ext3:
[code]
mke2fs -j /dev/sdb1
[/code]Mounting:
[code]
mount /dev/sdb1 /path/to/anywhere
[/code]Add a line to /etc/fstab
[code]
/dev/sdb1 /mount/path ext3 noatime 0 1
[/code][/QUOTE]
Thank you very much.
How do I know what the hard drive will be called? I don't want to just go around mounting things because last time I did that, it killed a system. And what would happen if I set the mount path to /home/maccabee (which already exists.) Would it overwrite the files or would the sort of work in conjunction?
Also, last thing, does the spacing matter in /etc/fstab file because I noticed all the partitions have the numbers at the end in different spots.
[QUOTE=Maccabee;21180597]Thank you very much.
How do I know what the hard drive will be called? I don't want to just go around mounting things because last time I did that, it killed a system. And what would happen if I set the mount path to /home/maccabee (which already exists.) Would it overwrite the files or would the sort of work in conjunction?
Also, last thing, does the spacing matter in /etc/fstab file because I noticed all the partitions have the numbers at the end in different spots.[/QUOTE]
You can use
[code]
fdisk -l
[/code]
To get a list of partitions and drives. It shows the sizes in blocks and not GB, but you can still figure out which is which because the bigger hard drive will have more blocks.
If you try to mount a device to /home/maccabee, it'll give you an error saying it can't mount to a non-empty directory. You can mount it to /home/maccabee/emptydir/ though.
The reason why you can't mount to a non-empty dir is because then the system doesn't know which device to write to if you put something new in there. If you really want to get around that, you can use an LVM system. Fedora uses a LVM by default, but I don't know how to manually set one up. Basically it takes multiple hard drives and creates one big filesystem out of them that spans the drives.
And the spacing doesn't matter in /etc/fstab. Just as long as there is some whitespace between each file.
[editline]12:02AM[/editline]
Doh! I was wrong about fdisk only outputting sizes in blocks.
I didn't read the full output. The GB size is right at the top.
[code]
gentoobook casey # fdisk -l
Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x1a7c51dd
Device Boot Start End Blocks Id System
/dev/sda1 * 1 14 112423+ 83 Linux
/dev/sda2 15 80 530145 82 Linux swap / Solaris
/dev/sda3 81 38913 311926072+ 83 Linux
gentoobook casey #
[/code]
Perfect, thanks :buddy: I'll set that up tomorrow.
If you have the time / chance, swap the drives over. 40gb as the system disk + personal files.
80gb drive mounted in /srv for backups and such.
How would I do that? I've already done a lot of configuring to this os so I can't re install. And what would be that pros of that anyway?
Sorry, you need to Log In to post a reply to this thread.