PDA

View Full Version : Help ! Hdb partitions not recognized


Happy Jack
2007-02-19, 07:20 PM CST
I added a new 320 gb drive to my existing 80 on FC6. I formatted it with fdisk to add the /hdb1-hdb5 partitions you see below. But I think I am wrong about my entries to fstab.

Please tell me what my entries should be in fstab.

Thanks


[root@Hawk ~]# cat /etc/fstab
LABEL=/ / ext3 defaults 1 1
LABEL=/boot1 /boot ext3 defaults 1 2
devpts /dev/pts devpts gid=5,mode=620 0 0
tmpfs /dev/shm tmpfs defaults 0 0
LABEL=/home /home ext3 defaults 1 2
LABEL=/opt /opt ext3 defaults 1 2
proc /proc proc defaults 0 0
sysfs /sys sysfs defaults 0 0
LABEL=/tmp /tmp ext3 defaults 1 2
LABEL=/usr /usr ext3 defaults 1 2
LABEL=/usr/local /usr/local ext3 defaults 1 2
LABEL=/var /var ext3 defaults 1 2
LABEL=SWAP-hda10 swap swap defaults 0 0
/dev/hdb1 /u01 ext3 defaults 1 2
/dev/hdb2 /downloads ext3 defaults 1 2
/dev/hdb3 /source ext3 defaults 1 2
/dev/hdb4 /backup ext3 defaults 1 2
/dev/hdb5 /web ext3 defaults 1 2

[root@Hawk ~]# mount -a
mount: mount point /u01 does not exist
mount: mount point /downloads does not exist
mount: mount point /source does not exist
mount: mount point /backup does not exist
mount: mount point /web does not exist

[root@Hawk ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/hda2 27G 487M 25G 2% /
/dev/hda1 965M 27M 889M 3% /boot
tmpfs 506M 0 506M 0% /dev/shm
/dev/hda6 5.7G 2.0G 3.4G 37% /home
/dev/hda7 4.8G 138M 4.4G 4% /opt
/dev/hda9 3.8G 73M 3.6G 2% /tmp
/dev/hda3 15G 2.8G 11G 21% /usr
/dev/hda8 4.8G 139M 4.4G 4% /usr/local
/dev/hda5 9.5G 267M 8.8G 3% /var
[root@Hawk ~]# fdisk /dev/hdb -l

Disk /dev/hdb: 320.0 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hdb1 1 10000 80324968+ 83 Linux
/dev/hdb2 10001 15000 40162500 83 Linux
/dev/hdb3 15001 20000 40162500 83 Linux
/dev/hdb4 20001 30000 80325000 5 Extended
/dev/hdb5 20001 30000 80324968+ 83 Linux
[root@Hawk ~]# mount /mnt/dev/hdb1
mount: can't find /mnt/dev/hdb1 in /etc/fstab or /etc/mtab
[root@Hawk ~]#

stevea
2007-02-19, 07:37 PM CST
Your fstab entries look OK but you must create directories to mount these on:
mkdir /u10
mkdir /downloads
mkdir /source
mkdir /backup
mkdir /web
mount -a


Also you didn't mention it, but fdisk does NOT create files systems. It only creates partiions. You need to use "mkfs" to make file systems like
mkfs /dev/hb1
...


I would strongly urge you to install gparted and use it instead of using fdisk & mkfs. It's much easier and less error prone.
yum install gparted
gparted

marcrblevins
2007-02-19, 08:00 PM CST
my drive would be /dev/hdi according to fdisk -l

I use the whole drive as backup drive

So:
su -
fdisk /dev/hdi
You need to create partitions there and change type to 83 for Linux type

mkfs.ext3 /dev/hdi1
mkdir /mnt/backup
vi /etc/fstab
copy one line and overwrite it
/dev/hdi1 /mnt/backup ext3 defaults 1 1
:wq
mount /mnt/backup

To see the sizes of all drives
df -k

stevea
2007-02-19, 09:07 PM CST
I think there are a few other works I should say here. "qtparted" is a decent package too, tho' I prefer "gparted".

The bigger question is -- why do you want to break you big honkin 320GB disk into so many little pieces. ?
For example let's say a year from now your /web partition is full, but your /source partition is only 10% full. Now you have a problem and there aren't any pretty solutions. You are building brick-walls where moveable partitiions would be a better choice.

If instead you made both a /web directory and a /source directory on the same partition then the space is used dynamically by whichever requires it. A much better solution.

You do need a swap parttition somewhere.
If you want to add/change/remove storage then use LVM.
If you use LVM or some cosmic file system for root, then do keep /boot in it's own ext3 partittion.
You may want to keep a real backup in a separate /backup partittion.

I prefer to keep a current root file system (~25GB) and a secondary partion of the same size (was used for FC5, and will be used for FC7). Then when I switch to a new FCn, I can just install and dual-boot back to the old until a clean transition is accomplished - often a few weeks.

Now if you put most of your regularly accessed files (the rootfs, the /home and maybe your /web fall in that category) onto a software raid0 across two drives you'll see a dramatic performance increase. The infrequently used stuff /backup and perhaps others) don't require a raid0 performance. Linux raid0 in sw has high performance, low CPU overhead and does NOT require you to have two identical disks.

Anyway - you can do the math for your situation, but generally slicing your disk into a lot of tiny partitions isn't the best approach.

Mount a single larger partition somwhere (/opt is my choice) and make some links like
mkdir /opt/web
ln -s /opt/web /web

There isn't much reason for more than 5 - 6 partittions total unless you are serving up sourceforge or running an IT operation.

Happy Jack
2007-02-20, 07:36 AM CST
Thank you for your help.

I tried using mkdir but could not create the directory on the hdb drive instead of the hda drive.

Happy Jack
2007-02-20, 07:38 AM CST
My impression, correct me if I am wrong, is that I cannot create a root partition on the hdb device while I already have it on the hda device. I don't want to be deleting partitions because I have the network set up just right and don't want to change anything.

marcrblevins
2007-02-20, 10:18 AM CST
All mkdir directories will be on the first drive anyway, once you mount to that directory, it will use the drive where ever you mounted from.

Example:
mkdir /mnt/backup, that would be in hda drive

ls /mnt/backup, nothing there, zero bytes.

mount /mnt/backup, that would mount hdb to hda's /mnt/backup directory.

ls /mnt/backup, hdb stuff is here, no longer zero bytes.