Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I recently bought a 200 GB HD that I just installed. What I need to do now is to format it, and I've looked through some sites to see how I can use fdisk and such, but I have some questions still. I have another (and much, much smaller) HD in my system already that I have installed RedHat 8 and where I have all my files.
I want to know how I should format the new disk, and I don't need a boot section and stuff. How would you recommend formatting and partitioning a HD like that? I'm using this PC as a workstation.
1. First, find out what the device is where linux "sees" the new drive. E.g. if it's master on the second IDE bus, it will be /dev/hdc.
The easiest way to get this right is to open a console and type "dmesg | grep ^hd"
Then you will see the names of all drives as well as their capacity.
For the following I will assume it's hdc
You should also choose which type of filesystem you would like. ext2 and ext3 are most common, the difference being ext3 survives crashes without the need to do a complete check afterwards. There is also reiserfs, which is less common but higher performance, and also survives disk crashes without the need to do a check. Or you can use fat32 for a dual boot system where you also want the data to be accessible through windows.
2. Partition the new drive. You will probably just want one big partition of 200GB. A good tool for this is "parted". Do "parted /dev/hdc" (as root). It gives it's own prompt, now give it the command "print". It shouldn't show any existing partitions, otherwise you took the wrong drive (your older hd) and that could be disastrous later on It also shows the total amount of MB's available.
Now it's time to create the new partition: "mkpartfs primary type 0 size"
where type is either ext2, fat32, or reiserfs; and size is the size in megabytes that was shown by "print".
Then "quit" to exit parted.
The nice thing about parted is that it will ALSO automatically format the partition for you. So you don't need to do that in advance.
Beware, if you want to use reiserfs, I don't know if Red Hat supports it by default. It may be possible you need to install some rpm first!
3. Now, to be able to mount the partition, add a line in /etc/fstab (use your favorite editor). The line should read
I met a problem when I wrote "parted /dev/hdb" as root. Among a lot of other messages, this one showed up:
"Using /dev/hdb
Error: Unable to open /dev/hdb - unrecognised disk label."
Do you know what that means?
And nothing shows up when typing "dmesg | grep ^hd" either. I believe I put the jumper on the disk correctly as slave.
The rest of your format and partition guide looks promising, and I look forward to try it out when I have these problems solved. Thanks again!
And btw, do you think one big 200 GB partition is a good thing or should I part it into smaller partitions?
Last edited by rundjuling; 10-02-2004 at 01:17 PM.
Originally posted by rundjuling I met a problem when I wrote "parted /dev/hdb" as root. Among a lot of other messages, this one showed up:
"Using /dev/hdb
Error: Unable to open /dev/hdb - unrecognised disk label."
Do you know what that means?
That's weird, but parted has been known to be a bit "picky" of bios etc... -- maybe better try "fdisk" then, but then you'll need to do the formatting by hand after partitioning. I don't know by heart how to use fdisk, but i think it's a bit similar
Quote:
And nothing shows up when typing "dmesg | grep ^hd" either. I believe I put the jumper on the disk correctly as slave.
When just typing "dmesg", does it give anything at all? If it doesn't, the same data (i.e. the boot log) can also be found (usually) in the file /var/log/boot.log
If there's no line somewhere in it like "hdb: make/model, xxxxxxx sectors" then there is a problem with cables/jumpers
Quote:
And btw, do you think one big 200 GB partition is a good thing or should I part it into smaller partitions?
That's entirely up to you -- in linux there is no technical reason you shouldn't make 1 big partition (it should only be smaller then 4TB (=4096GB) ) ; it depends on what you want to use the drive for.
So please let me know if you find anything about hdb in "dmesg" or in /var/log/boot.log ... if not, check BIOS settings or cables...
Originally posted by nukkel When just typing "dmesg", does it give anything at all? If it doesn't, the same data (i.e. the boot log) can also be found (usually) in the file /var/log/boot.log
If there's no line somewhere in it like "hdb: make/model, xxxxxxx sectors" then there is a problem with cables/jumpers
"dmesg" didn't give me any output other than numerous messages from the dvd-player.
And the boot.log file didn't contain that like you wrote there. So I guess I have to recheck my cables and jumper settings again. I guess it is slave it's supposed to be, and I thought that was what I said it should be. Anyway.
Quote:
So please let me know if you find anything about hdb in "dmesg" or in /var/log/boot.log ... if not, check BIOS settings or cables...
Yeah, both came out negative, so I'm gonna check some cables... Thanks again so far.
Hm, I never thought this was gonna cause this much trouble.
Now I removed the jumper on the HD to really get it a slave, but I don't see that much of a difference. Well, the little beep when turning the PC on went away but I don't get anything listed when typing dmesg | grep ^hd, nor doing the parted /dev/hdb, cause then it would make the error message "Unable to open /dev/hdb - unrecognised disk label.".
But when typing grep hdb /var/log/dmesg, it prints some info about the HD:
Code:
ide0: BM-DMA at 0x10a0-0x10a7, BIOS settings: hda:pio, hdb:DMA
hdb: Maxtor 6Y200P0, ATA DISK drive
hdb: 398297088 sectors (203928 MB) w/7936KiB Cache, CHS=24792/255/63, UDMA(33)
hdb: unknown partition table
At least we're sure the kernel sees the drive. It's strange, I never had this problem with parted. Well, maybe use another program for partitioning, if you have sfdisk, you can do the following (sfdisk has a somewhat awkward syntax):
Code:
cat ";" | sfdisk /dev/hdb
I haven't tried this myself (naturally ) but this should create one big partition
It is possible to check if it turned out OK, by doing "sfdisk -l -V /dev/hdb"
After that, if it worked, it will still need to be formatted:
mke2fs /dev/hdb1 (for an ext2),
mke2fs -j /dev/hdb1 (for ext3),
mkreiserfs /dev/hdb1 (reiser), or
mkdosfs -F 32 /dev/hdb1 (fat32)
First off thanks nukkel for the get walk through on the hard drive setup. It really helped me get my WD-200gig hard drive up and running, but I ran into one small problem.
I tried to setup permissions so that the root wasn't the only user that could write to the drive, but it keeps telling me that I don't have sufficient status to change the permissions even though I am logged in as root. I am sure that this is just a newbie problem but I sure could use some help.
First off thanks nukkel for the get walk through on the hard drive setup. It really helped me get my WD-200gig hard drive up and running, but I ran into one small problem.
I tried to setup permissions so that the root wasn't the only user that could write to the drive, but it keeps telling me that I don't have sufficient status to change the permissions even though I am logged in as root. I am sure that this is just a newbie problem but I sure could use some help.
Hi, I've been away from linuxquestions.org awhile...
Have you by any chance used the vfat (=FAT32) file system? It cannot store permission/user/group information, so with this filesystem it's impossible to change permissions. In this case, you can make all files on it appear to have a certain permission/user/group by editing the /etc/fstab entry for it: add umask=0 to the option field to give full access to everyone.
If you're using ext2/ext3/reiser, then sth else is wrong...
Hello guys, I have to say I'm having the same problem as rundjuling with the exception my HDD has a corrupted NTFS partition on it. Recently I was think on formating to use it as backup. I'm using a USB to IDE connector so the drive shows ups as /dev/sda also the drive its a Seagate st340015a
Here is my dmesg output.
[17179599.188000] [drm] writeback test succeeded in 2 usecs
[17179600.836000] apm: BIOS not found.
[17179605.444000] NET: Registered protocol family 10
[17179605.444000] lo: Disabled Privacy Extensions
[17179605.444000] ADDRCONF(NETDEV_UP): eth0: link is not ready
[17179605.444000] IPv6 over IPv4 tunneling driver
[17179616.348000] eth1: no IPv6 routers present
[17179673.660000] ieee80211_crypt: registered algorithm 'WEP'
[17179684.224000] eth1: no IPv6 routers present
[17180237.788000] usb 4-3: new high speed USB device using ehci_hcd and address 3
[17180237.920000] usb 4-3: configuration #1 chosen from 1 choice
[17180238.040000] usbcore: registered new driver libusual
[17180238.120000] SCSI subsystem initialized
[17180238.124000] Initializing USB Mass Storage driver...
[17180238.124000] scsi0 : SCSI emulation for USB Mass Storage devices
[17180238.124000] usbcore: registered new driver usb-storage
[17180238.124000] USB Mass Storage support registered.
[17180238.124000] usb-storage: device found at 3
[17180238.124000] usb-storage: waiting for device to settle before scanning
[17180243.124000] usb-storage: device scan complete
[17180243.128000] Vendor: SAMSUNG Model: MP0402H Rev: 0811
[17180243.128000] Type: Direct-Access ANSI SCSI revision: 00
[17180243.160000] SCSI device sda: 78242976 512-byte hdwr sectors (40060 MB)
[17180243.160000] sda: test WP failed, assume Write Enabled
[17180243.160000] sda: assuming drive cache: write through
[17180243.164000] SCSI device sda: 78242976 512-byte hdwr sectors (40060 MB)
[17180243.164000] sda: test WP failed, assume Write Enabled
[17180243.164000] sda: assuming drive cache: write through
[17180243.164000] sda: sda1
[17180243.640000] sd 0:0:0:0: Attached scsi disk sda
[17180243.648000] sd 0:0:0:0: Attached scsi generic sg0 type 0
[17180244.040000] FAT: utf8 is not a recommended IO charset for FAT filesystems, filesystem will be case sensitive!
[17180298.784000] usb 4-3: USB disconnect, address 3
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.