LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   new disk, no can use (https://www.linuxquestions.org/questions/linux-newbie-8/new-disk-no-can-use-38122/)

sx10 12-12-2002 10:30 AM

new disk, no can use
 
Sorry about this again, vmware of course but probably not the reason. Added a new IDE drive as the old one filled up. Boot can see the new /dev/hdb and using fdisk -l I can see it is "blank".
Many hints say use cfdisk, well where can I get it? Part of utilities?
Is there another easy way to "format" the new drive or what do I have to do to get data allocated on it. Message out is
Disk /dev/hdb doesn't contain a valid partition table
Sx10

Thymox 12-12-2002 10:34 AM

As root, you can use fdisk /dev/hdb, or you can use cfdisk. It provides a nicer interface than fdisk does, but it essentially does the same job. Which distro are you running, by the way? It comes already installed on some/most.

Skilless 12-12-2002 10:35 AM

This is something I wrote for another forum awhile back; I'm just doing a copy-n-paste due to my laziness, but you should be able to get enough info out of it to do what you want....


=============================================

Adding HD Space to Existing Linux Installation


Essentially, you either need to add a HD or allocate more space from a current HD (if you are dual booting). Here are the steps for doing so, you'll need to be root/su to do this stuff;

1. If you put in another HD, you'll need to partition the drive unless you want one big disk
a. fdisk is the tool of choice here

2. You'll need to format with a Linux file system (ext3 is my pref) --> I'm going to call the 'new' HD hdb.
a. mke2fs /dev/hdbX (repeat for each partition)
b. tune2fs -j /dev/hdbX (repeat for each partition)

3. You'll need to name the new partitions and move/copy files over, this can be where you screw stuff up, because you already have a running system, and now you're going to want to replace directories in the complete system (like you probably have a /usr and a /home partition|directory| file), so if you are going to "transfer" those to the new HD, be sure to read up on doing the "move" at various Linux doc/help sites before doing anything!!!

-- Assuming you want to make /home bigger --
a. prepare to move /home to hdb1
mkdir /temphdb
mount /dev/hdb1 /temphdb

b. copy the files over to the new drive
cd /home
cp * /temphdb (you could tar everything up first, I guess, but that's more trouble than its work if you ask me)

c. prepare to make the change in venue
umount /temphdb
rm -rf /home/*
rm -rf /home/.*

d. make hdb1 the new /home
mount /dev/hdb1 /home

e. repeat for each "new" location/partition (such as /usr, or whatever), mounting as above to the temporary directory, etc.
mount /dev/hdb2 /temphdb

4. You'll need to add a line into /etc/fstab to mount the drive at boot up. Be sure to back up your previous fstab
a. cp /etc/fstab /etc/fstab.bak
b. vi /etc/fstab

-- You probably can use one of the other HD mounting lines as an example, but basically you just change the line as follows;

c. /dev/hdb1 /home ext3 defaults 0 0 (using the first example above, I'm mounting the new HD partition 1 to /home).

Appendix: One tool I've used before within the GUI is DiskDrake, which will allow you to work on the partitions.


Good luck!

==========================================

sx10 12-12-2002 11:40 AM

Thx, works!


All times are GMT -5. The time now is 01:10 AM.