Link to home
Start Free TrialLog in
Avatar of ftpfreak
ftpfreak

asked on

New SCSI drive

on my ibm tower server i have 6 bays. i already install fedora core1 on the first scsi drive. i put the first scsi drive at the lowest part of the bays. today i just add new scsi drive which is same brand and same saiz like current. but fc1 seems didnt show anything whill booting up. but i manage to see the new hdd. I want to make this new scsi drive as a backup file. where there is no partition like current drive, it's like in windows where i just format it and it i can't see any folder, then i can manage to create a folder or backup file. How do I format the new drive and can be visible to me on fc1?

here my cat /etc/fstab

LABEL=/ / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
none /dev/pts devpts gid=5,mode=620 0 0
none /proc proc defaults 0 0
none /dev/shm tmpfs defaults 0 0
/dev/sda3 swap swap defaults 0 0
/dev/cdrom /mnt/cdrom udf,iso9660 noauto,owner,kudzu,ro 0 0
/dev/fd0 /mnt/floppy auto noauto,owner,kudzu 0 0

here is my /etc/mtab

/dev/sda2 / ext3 rw 0 0
none /proc proc rw 0 0
none /dev/pts devpts rw,gid=5,mode=620 0 0
usbdevfs /proc/bus/usb usbdevfs rw 0 0
/dev/sda1 /boot ext3 rw 0 0
none /dev/shm tmpfs rw 0 0

here is my cat /proc/mounts

rootfs / rootfs rw 0 0
/dev/root / ext3 rw 0 0
/proc /proc proc rw 0 0
/dev/pts /dev/pts devpts rw 0 0
usbdevfs /proc/bus/usb usbdevfs rw 0 0
/dev/sda1 /boot ext3 rw 0 0
none /dev/shm tmpfs rw 0 0

previously i said i can see my new drive when i type this command fdisk -l
and here is the result

Disk /dev/sda: 73.4 GB, 73407488000 bytes
255 heads, 63 sectors/track, 8924 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 8696 69746197+ 83 Linux
/dev/sda3 8697 8924 1831410 82 Linux swap

Disk /dev/sdb: 73.4 GB, 73407488000 bytes
255 heads, 63 sectors/track, 8924 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System


What I planned to do after format the new drive is to move the /var and /home folder into the new drive....

Avatar of Julian Parker
Julian Parker
Flag of United Kingdom of Great Britain and Northern Ireland image

Hi,

If I understand your question correctly, you need to partition and format it like any other drive. I've added the following as an example.

     # fdisk /dev/sdb

Create a new partition 5GB in size.
     Command (m for help): n
     First cylinder (5-1292, default 5): <ENTER>
     Using default value 5
     Last cylinder or +size or +sizeM or +sizeK (5-1292, default 1292):+5000M

Repeat the create new partition for each one you want to create.

Write the partition to disk by press w and <ENTER>

Display the parition information
     # fdisk -l /dev/sdb

Newfs the partitions you created.
     # mkfs -t ext3 /dev/sdb1

Create mount points and mount the partitions for the temporary move. Ideally you may want to be in single user for this.
     # mkdir /newvar /newhome
     # mount -F ext3 /dev/sdb1 /newvar
     # mount -F ext3 /dev/sdb2 /newhome

Copy the data...
     # cd /var
     # find . -mount -print | cpio -puvdm /newvar
     # cd /home
     # find . -mount -print | cpio -puvdm /newhome

Modify fstab, you can use Labels for the file systems if you wish, check out e2label for more information.
     # vi /etc/fstab
     /dev/sdb1 /var ext3 defaults 1 2
     /dev/sdb2 /var/ext3 defaults 1 2
     :wq!

From the top of my head I think thats it but don't blame my if it goes t1ts up. You should be able to boot single user if something is out of place. Post back here with more information if you need to.

Regards

Jools
Avatar of ftpfreak
ftpfreak

ASKER

how about if i just want to create i single partition on new drive?...

i just like windows system where i got 2 drive....first drive is install with the OS, application and the second drive is just to store the My DOcument....

can i change the 5GB to 73.4GB?
ftpfreak


There is no problem about having whole hard drive to have just one partition. You can create primary partition for 73.4GB. In case that you have just one primary partition its name will by /dev/sdb1 . So do not create logical partiton because there in no point to do that then just use same mountpoints as are shown in jools previous comment.

Also instead of fdisk you can use cfdisk which it seem to me more user friendly as fdisk but it does same job. Check man page: # man cfdisk and then just create filesystem and edit /etc/fstab like shown in jools previous comment.


If you still want to have partition big 73.4GB just keep in mind that smaller filesystems are more ease to manage and also are better to recover after some damage like big filesystems like in your case 73.4GB big partition. But anyway there is nothing wrong about partition big 73.4GB.

Luxana



thanks...but will the Jools sugguestion to me on how to create partition will works?...because i worried if something went wrong
Luxana....

so what is your suggestion?

i just want to change and copy current /home and /var directories to the new drive...

so for you all experience....what is best directory for me to move to the new drive other than home and var?

thanks
Ok...

i just want to change and copy current /home and /var directories to the new drive

with word change you think that you want use this new partition for /var and for /home so you will no longer use current /var and /home folders.

In that case you can do :

1)
create two partitions on new hard drive for /var and /home with cfdisk or fdisk let's say :
primary partition 50GB for /home
/dev/sda1
primary partition rest of space for /var
/dev/sda2
2)
then create filesystem :

# mkfs -t ext3 /dev/sdb1
# mkfs -t ext3 /dev/sdb2
3)
mount tempor. new partitons to /mnt/dir1 /mnt/dir2

# mount -t ext3 /dev/sda1 /mnt/dir1
# mount -t ext3 /dev/sda2 /mnt/dir2

4)
this task  do in single user mode
copy data:
# find /home -mount -print | cpio -puvdm /mnt/dir1
# find /var -mount -print | cpio -puvdm /mnt/dir2

5)
edit /etc/fstab

/dev/sda1       /home           ext3    defaults       0       2
/dev/sda2       /var           ext3    defaults       0      0

-----------

your data on current /home and /var will stay because you will mount new folders /var/ and /home on top of the currents directories. When everitgs will work finne just umount /var and /home directories and remover old data to make more free space do that also in single mode.

if you are unsure about somethnig just ask.

let us know how you doing...!

Luxana





ftpfreak
You don't have to use the 5GB partition size I specified, you can change this to suit your own needs.

There is no problem in using just one large partition, in face the defaults for creating the partition in fdisk will probably default to allow you to do that anyway. Don't forget though that you originally wanted to have 2 partitions copied to the new disk. Whilst this is fine the disk layout and fstab could get a little messy. It it were me I'd just create the two or three partitions and be done with it.

Perhaps if you tell us what you're actually wanting then we could suggest some specific sizes, I wouldn't create large /home and /var partitions without knowing what I wanted to achieve.

Luxana
I agree that cfdisk is easier to use but it has been depricated since about RH 7.1 and although you may be able to get a copy with all the other dependencies fdisk easily does the job. There may be an option to use sfdisk but I've not used it myself.

BTW, who mentioned creating Logical Partitions....not that it actually matters what is used?


Jools
BTW, who mentioned creating Logical Partitions....not that it actually matters what is used?


Nobody metioned to create logical partitions and thats way I metioned that because ftpfreak will have an option before he create new partitions so I jast wanted him to choose primary:-)

hmm...what are the best for server? i mean for the secondary scsi hdd
post a df-k here and we may be able to suggest something...

Also, if you can include some details of what you want to get out of the disk layout that would help too.

J
ftpfreak,

Everything depends on your needs to by honest with you I'm now a bit confused about what you are trying to do and about the reason as well. As jools said please give as some more informations about your server and what are you using your server for. Also try paste her command

# fdisk -l
with sort description about the output.

Luxana
[root@domain root]# df -k
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda2             68650036   1753620  63409108   3% /
/dev/sda1               101086      8708     87159  10% /boot
none                    516120         0    516120   0% /dev/shm
[root@domain root]#

[root@domain root]# fdisk -l

Disk /dev/sda: 73.4 GB, 73407488000 bytes
255 heads, 63 sectors/track, 8924 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot    Start       End    Blocks   Id  System
/dev/sda1   *         1        13    104391   83  Linux
/dev/sda2            14      8696  69746197+  83  Linux
/dev/sda3          8697      8924   1831410   82  Linux swap

Disk /dev/sdb: 73.4 GB, 73407488000 bytes
255 heads, 63 sectors/track, 8924 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot    Start       End    Blocks   Id  System
[root@domain root]#
luxana, i just want to create a secondary drive formated and viewable to my fedora....then i want to move the /var and /home directory to the new drive...that mean for example, if new user is add in to my fedora, it wont go to /home at first drive, so it go to second drive
ok so then just do what I wrote above. Just to sum it up create two diferent partitons on /dev/sdb one /var=/dev/sdb1 and another /home=/dev/sdb2 copy the all files and edit /etc/fstab to mount your new partitons on top of the current /home and /var directories. Do that when your clients do not need to go to their home directories and are not loged in ,the best way is single mod escpecialy /var directory. Remeber that if you mount your new home direcotry on top of current one you will not see your old files unless you unmount the new /home directory.

LUXANA

and one more think you do not need to do both partions at once try first /home edit /etc/fstab I see if it works then add one more. Also is good to do testing first if you are not sure about what you are doing. Lets say create partions and map in in /etc/fstab to /test folder wich you will create first...

try and let us know how you doing:)))
ASKER CERTIFIED SOLUTION
Avatar of Julian Parker
Julian Parker
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
i will follow which is more efficient...thanks and i will try it out
i succesfull add new drive...i do a parition for /var, /usr, and /home to the second drive..this is for server purposes. i planned to do if the system is corrupt..so i just need to install on the first drive and leave it the second drive...is the folder that i choose is correct folder? /var /usr and /home..thanks
Can you clarify your question please, give examples of what you want to do if it helps.

J
no i mean...i succesfully follow the method, but for most server administrator, which directory in linux should be saparate?
> but for most server administrator, which directory in linux should be saparate?

/var
/home