hard drive specs?

Does anybody know what command will bring up my harddrive and how much room is left on it?

use command "df".

For more information, man df or df --help

Type the following:

dmesg |grep hd
dmesg |grep sd
dmesg |grep id

This should give you a list of all your hard drives. hd? (? is a letter of the alphabet) will be IDE drives, sd? will be SCSI, and id? may show up if you are on a Proliant box. You may get some other junk as well but you can probably figure it out.

Now, run 'fdisk /dev/hda' or what ever disks you ended up finding. You may want to run a man on fdisk first. It's not the most strait forward tool.

perfect, thanks haha this is actuily alot better than windows. I can see great things in teh future .... lol. This is my first attempt at RH on my own so it's nice to have the help...thnx

shucks haha just as i though, i set the wrong HD ... is there any way to write to my second hard drive...like in windows you have c: d: e: etc... can i do that here? I've only got about 2 gigs left free and i've got another 20 gig sitting doing nothing haha.

When i run the dmesg |grep hd command i get hda and hdb so i'm assuming that it picks up my 2 hard drives.

ide0: BM-DMA at 0x4000-0x4007, BIOS settings: hda:DMA, hdb:DMA
ide1: BM-DMA at 0x4008-0x400f, BIOS settings: hdc:DMA, hdd:DMA

hda: FUJITSU MPD3084AT, ATA DISK drive
hdb: WDC WD200BB-00CXA0, ATA DISK drive
hdc: LG CD-RW CED-8120B, ATAPI CDROM drive
hdd: LTN483, ATAPI CDROM drive
hda: FUJITSU MPD3084AT, 8063MB w/512kB Cache, CHS=1027/255/63
hdb: WDC WD200BB-00CXA0, 19092MB w/2048kB Cache, CHS=38792/16/63
hda: hda1
hdb: hdb1

But i've got it writing files to the wrong one...i want it to write all my big files that i transfer to hdb1...is there any way i can do this?

[root@linksys /root]# df
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/hda1 8119744 5895872 1811408 77% /

hda means the master or primary or first harddrive. hda1 means the first partition on this harddrive. Secondary or slave is hdb, etc.

I don't know what you want. you want to copy or cut files to other partition / drive ?

Yes i want to beable to copy and just for the future store all my files on the big hard drive haha. Thank you for explaining that to me though, i get it a bit better now.

  1. Use fdisk /dev/hdb to set up the partition on the second disk. This may already be done since dmesg showed /dev/hdb1.

  2. Create a filesystem on hdb1. 'mkfs /dev/hdb1' will create an ext2 filesystem. 'mke2fs -j /dev/hdb1' will create an ext3 filesystem.

  3. Make a directory in /. Call it what ever you want. It will be your mount point for the second disk. For example 'mkdir /disk2'.

  4. Mount the second disk - 'mount /dev/hdb1 /disk2'.

Then copy away.

Perfect, it worked ... thanks man. Sorry i didn't have a chance to do it earlier but i've been dieing of some stupid virus going arround. So will i have to mount the file system every time i turn the computer on or will it mount it self?

Hey, it's weird when i try to copy anything over to the new partition it gives me an error...either

omitting directory 'file name'
or
cp cannot create regular file: 'dir to file': Input/Output error

Is this a problem with my new partition or am, i just doing somehting really stupid. I'm using the cp command to copy things over.

cp /FTPfiles/* /disk2/ftpfiles

i've tried that and doing just the files sepratly and i get those errors.

I don't recall ever seeing that exact error but it may be because you are trying to copy a directory and not using the -R on the cp command. Typically if I am copying data and I want it to retain the same date, timestamps, permissions, etc I would use tar piped to tar like this:

tar cf - /FTPFiles/* | (cd /disk2/ftpfiles; tar xf -)

This assumes /disk2/ftpfiles is a directory that already exists.

To have disk2 mounted automatically, simply add it to /etc/fstab. I don't know your device but it will look something like this:

/dev/hdb1 /disk2 ext3 defaults 1 2

I'm doing it from memory so I hope I didn't forget any feilds.

oh haha thanks, i wondered why when i restarted my computer it wasen't there haha i'll do that right now while i'm feeling ok. Where did you learn all this from, how long have you been at this?

Oh and i don't really get the command
tar cf - /FTPFiles/* | (cd /disk2/ftpfiles; tar xf -)
could you break it down for me please just so i understand how it works...it's mostly everything after the pipe that i don't get.

When i ran the command it said cowardly refusing to make an empty archive.

I don't know what it is...all my other files copied over fine, it's just two stupid directories.

It just takes time to learn all this. I have a degree in computer science and have been working with Unix and Linux for about 10 years. My best advice is read a lot and play with any hardware and OSes you can get your hands on. The cool thing about Linux and Unix is there is always more to learn. It's pretty much infinite for all practical purposes. Even guys like Perdarabo probably still learn new things pretty frequently. I can only hope to learn as much as he already knows.

For the tar command:

tar cf - /FTPFiles/*. This part creates a tar of all the files tar are in /FTPFiles. The "-" after the cf part just redirects the contents of the tar file to STDOUT instead of to a file. This is where the pipe comes in.

The | takes the STDOUT and redirects it to the next set of commands as STDIN. The () make these work as 1 unit. First we cd to /disk2/ftpfiles then is "untars" the data passed via -. The tar xf - uses "-" the same as the tar cf did. It opens what was STDOUT and has been changed to STDIN by the | to expand the archive. Basically you are using - as a file to pass info without actually creating a file on disk.

Your error may be caused if /FTPFiles doesn't have any files in it yet.

Thanks for the break down haha i get it now...that was weird though, i've never seen a command liek tha tbefore...lol it threw me through a loop.