Mounting a new disk on linux server

Hi All.
I am pretty new when it comes to Linux. My admin left on vacation and has presented 2 new disks to the server but they won't be seen until I can reboot the box this weekend.
Once that happens I need the steps to make it available to my server and mount them as new filesystems. One will be for oracle data and the other for backup data.
Can anyone provide me with the steps neeed to complete this?
Here is some info I have on the current setup:

 
RCWLO-ODS10g:/ # uname -a
Linux RCWLO-ODS10g 2.6.16.60-0.42.8-smp #1 SMP Tue Dec 15 17:28:00 UTC 2009 x86_64 x86_64 x86_64 GNU/Linux
 
 
RCWLO-ODS10g:/ # df -k
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sdb3             98523580  56628620  41894960  58% /
udev                  40973400       188  40973212   1% /dev
/dev/sde1            1373587836 1142253616 231334220  84% /SAN
/dev/sda1               104376     41280     63096  40% /boot
/dev/sda2             20972152   6042020  14930132  29% /home
/dev/sdb1             33558712     66016  33492696   1% /tmp
/dev/sdb2             10490104   8796252   1693852  84% /u05
/dev/sda3             15735128    327916  15407212   3% /var
 
 
RCWLO-ODS10g:/ # cat /etc/fstab
/dev/disk/by-id/scsi-3600508e000000000b855ee6ec6289509-part3 /                    reiserfs   acl,user_xattr        1 1
/dev/disk/by-id/scsi-3600508b4001046910000800001110000-part1 /SAN                 reiserfs   defaults              1 2
/dev/disk/by-id/scsi-3600508e0000000004d55ca66b1287901-part1 /boot                reiserfs   acl,user_xattr        1 2
/dev/disk/by-id/scsi-3600508e0000000004d55ca66b1287901-part2 /home                reiserfs   acl,user_xattr        1 2
/dev/disk/by-id/scsi-3600508e000000000b855ee6ec6289509-part1 /tmp                 reiserfs   acl,user_xattr        1 2
/dev/disk/by-id/scsi-3600508e000000000b855ee6ec6289509-part2 /u05                 reiserfs   acl,user_xattr        1 2
/dev/disk/by-id/scsi-3600508e0000000004d55ca66b1287901-part3 /var                 reiserfs   acl,user_xattr        1 2
/dev/disk/by-id/scsi-3600508e0000000004d55ca66b1287901-part4 swap                 swap       defaults              0 0
proc                            /proc                   proc            defaults                        0 0
sysfs                           /sys                    sysfs           noauto                          0 0
debugfs                         /sys/kernel/debug       debugfs         noauto                          0 0
usbfs                           /proc/bus/usb           usbfs           noauto                          0 0
devpts                          /dev/pts                devpts          mode=0620,gid=5                 0 0
 

Thanks

The first question is should the disk be formatted? That is, should there be a file system on them.
I am not sure about Oracle Data. I know that sometimes Oracle uses raw disks for storage. If this is the case, then you need to determine the device of the new Oracle Data disk (is it /dev/sda /dev/sdb, etc') and configure Oracle accordingly.

If the disks need to be formatted, the first step would be to create a file system on them:

  1. Determine the device of the disks.
  2. Create one or more partitions on each disk using "fdisk" or the graphical tool "gparted".
  3. Decide which file system you want to use. It seems like you are using reiserfs for all the disks, and I assume you will use it for the new disks as well.
  4. use the "mkfs" command to create the file system.
  5. Update the "/etc/fstab" file so that the new formatted partitions will be automatically mounted when the system comes up, or manually.

BTW, what distribution are you using (look at /etc/issue)?

Yes the devices should be formatted.
I am not planning to use them for raw storage for Oracle and there will only be the one partition on both disks for the data.

You mention to determine the devices of the new disks? How do I do that exactly? What command should I run to see the disks after the reboot?

Currently there is:

RCWLO-ODS10g:/dev # cat /etc/fstab
/dev/disk/by-id/scsi-3600508e000000000b855ee6ec6289509-part3 /                    reiserfs   acl,user_xattr        1 1
/dev/disk/by-id/scsi-3600508b4001046910000800001110000-part1 /SAN                 reiserfs   defaults              1 2
/dev/disk/by-id/scsi-3600508e0000000004d55ca66b1287901-part1 /boot                reiserfs   acl,user_xattr        1 2
/dev/disk/by-id/scsi-3600508e0000000004d55ca66b1287901-part2 /home                reiserfs   acl,user_xattr        1 2
/dev/disk/by-id/scsi-3600508e000000000b855ee6ec6289509-part1 /tmp                 reiserfs   acl,user_xattr        1 2
/dev/disk/by-id/scsi-3600508e000000000b855ee6ec6289509-part2 /u05                 reiserfs   acl,user_xattr        1 2
/dev/disk/by-id/scsi-3600508e0000000004d55ca66b1287901-part3 /var                 reiserfs   acl,user_xattr        1 2
/dev/disk/by-id/scsi-3600508e0000000004d55ca66b1287901-part4 swap                 swap       defaults              0 0
proc                            /proc                   proc            defaults                        0 0
sysfs                           /sys                    sysfs           noauto                          0 0
debugfs                         /sys/kernel/debug       debugfs         noauto                          0 0
usbfs                           /proc/bus/usb           usbfs           noauto                          0 0
devpts                          /dev/pts                devpts          mode=0620,gid=5                 0 0
RCWLO-ODS10g:/dev #
RCWLO-ODS10g:/dev # ls -lrt /dev/disk/by-id/scsi-3*
lrwxrwxrwx 1 root root  9 Oct  2 11:40 /dev/disk/by-id/scsi-3600508b40010554c0000800000b30000 -> ../../sdd
lrwxrwxrwx 1 root root  9 Oct  2 11:40 /dev/disk/by-id/scsi-3600508b4001046910000800001110000 -> ../../sde
lrwxrwxrwx 1 root root 10 Oct  2 11:40 /dev/disk/by-id/scsi-3600508b4001046910000800001110000-part1 -> ../../sde1
lrwxrwxrwx 1 root root  9 Oct  2 11:40 /dev/disk/by-id/scsi-3600508e0000000004d55ca66b1287901 -> ../../sda
lrwxrwxrwx 1 root root  9 Oct  2 11:40 /dev/disk/by-id/scsi-3600508e000000000b855ee6ec6289509 -> ../../sdb
lrwxrwxrwx 1 root root 10 Oct  2 11:40 /dev/disk/by-id/scsi-3600508e000000000b855ee6ec6289509-part3 -> ../../sdb3
lrwxrwxrwx 1 root root 10 Oct  2 11:40 /dev/disk/by-id/scsi-3600508e000000000b855ee6ec6289509-part2 -> ../../sdb2
lrwxrwxrwx 1 root root 10 Oct  2 11:40 /dev/disk/by-id/scsi-3600508e000000000b855ee6ec6289509-part1 -> ../../sdb1
lrwxrwxrwx 1 root root 10 Oct  2 11:40 /dev/disk/by-id/scsi-3600508e0000000004d55ca66b1287901-part4 -> ../../sda4
lrwxrwxrwx 1 root root 10 Oct  2 11:40 /dev/disk/by-id/scsi-3600508e0000000004d55ca66b1287901-part3 -> ../../sda3
lrwxrwxrwx 1 root root 10 Oct  2 11:40 /dev/disk/by-id/scsi-3600508e0000000004d55ca66b1287901-part2 -> ../../sda2
lrwxrwxrwx 1 root root 10 Oct  2 11:40 /dev/disk/by-id/scsi-3600508e0000000004d55ca66b1287901-part1 -> ../../sda1
 
RCWLO-ODS10g:/dev # ls sd*
sda  sda1  sda2  sda3  sda4  sdb  sdb1  sdb2  sdb3  sdc  sdc1  sdd  sde  sde1  sdf  sdg
RCWLO-ODS10g:/dev #
 

I don't beleive sdf and sdg are being used but after the reboot will I see sdh and sdi? How can I see if sdf and sdg are being used. If they were I am assuming I would see sdf1 and sdg1 for the partitions.

Sorry if these are elementary questions. I appreciate your time in helping me with this.

Thanks

You do not have to reboot for the disks to be seen. You can either get the script called "rescan-scsi-bus.sh" from the web here:
http://www.garloff.de/kurt/linux/rescan-scsi-bus.sh-1.25

or try this:

for i in /sys/class/scsi_host/host*; do; echo "- - -" > /sys/class/scsi_host/$i/scan;
done;

I would try the script (make sure you run a chmod +x) and run the script like this

chmod +x rescan-scsi-bus.sh
./rescan-scsi-bus.sh -l -w -c

Now... for Oracle, if it will be for ASM it will still require a partition. You should learn some of the commands for fdisk from here:

fdisk(8): Partition table manipulator for - Linux man page

and then create the associated partitions, but not put any file systems on them. If by backup, you mean dumps of the tables, then you will need a filesystem

mkfs.<filesystemtype> should get you started. Many people use ext3, but any number of file system types should work, such as jfs, xfs, etc.

How to: Formatting Linux Filesystem

Based on the output, it appears you are running SUSE, is this correct? Yast would help you with a lot of this if you are.

---------- Post updated at 01:38 PM ---------- Previous update was at 01:36 PM ----------

Also, since you are using SAN based storage, and probably using some sort of multi-pathing (SANs, by the way they work, tend to show you multiple paths to the storage, and the operating system confuses them with actual drives), you should reference your drives like they are in /etc/fstab

Using either devmapper or /dev/disk/by-id rather than the sd? designation.

From the lists you provide, merely by comparing the output of your ls command with the contents of the fstab file you included, it appears to me that the new disk is sdd, since it has no partitions on it, and it is not covered by fstab (and consequently, I assume it is not in use). I cannot see he second new disk there.
of course, sdf and sdg are also new disks. They don't appear in the SCSI list for some reason.

You can use the fdisk program to look at each of these disks. You can see their size and the partitions created on them (if any).

Simply do (as a superuser): fdisk /dev/sdf (or sdg or sdd)
At the prompt type "p" to print the structure of the disk. You will be able to see its size and also any partitions created on it. I hope this information is sufficient for you to recognize the two new disks.

to exit the program type "q" at the prompt.

K we ended up needing to reboot the box anyway and now here is what I see:

 
RCWLO-ODS10g:/dev # ls sd*
sda  sda1  sda2  sda3  sda4  sdb  sdb1  sdb2  sdb3  sdc  sdc1  sdd  sdd1  sde
 

definitely different from what I saw last week so now I'm not sure what disk is showing up and what the 2 new disks are.

I tried doing:

 
RCWLO-ODS10g:/dev # fdisk /dev/sde
Unable to open /dev/sde
 

Any assistance would be appreciated.

Thanks

---------- Post updated at 09:54 AM ---------- Previous update was at 09:17 AM ----------

Also noticed that the SAN mount is on sdd now:

 
RCWLO-ODS10g:/dev # df -k
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sdb3             98523580  54541540  43982040  56% /
udev                  40973400       164  40973236   1% /dev
/dev/sdd1            1373587836 1143516980 230070856  84% /SAN
/dev/sda1               104376     41280     63096  40% /boot
/dev/sda2             20972152   7265444  13706708  35% /home
/dev/sdb1             33558712     66024  33492688   1% /tmp
/dev/sdb2             10490104   8796552   1693552  84% /u05
/dev/sda3             15735128    330820  15404308   3% /var
 

Can I assume that the sde is the new disk?

Run fdisk -l. It will show the capacities of the disks to help you pin it down more absolutely.

 
RCWLO-ODS10g:~ # fdisk -l
Disk /dev/sda: 72.9 GB, 72999763968 bytes
255 heads, 63 sectors/track, 8875 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        2624    20972857+  83  Linux
/dev/sda3            2625        4583    15735667+  83  Linux
/dev/sda4            4584        8875    34475490   82  Linux swap / Solaris
Disk /dev/sdb: 145.9 GB, 145999527936 bytes
255 heads, 63 sectors/track, 17750 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        4178    33559753+  83  Linux
/dev/sdb2            4179        5484    10490445   83  Linux
/dev/sdb3            5485       17750    98526645   83  Linux
Disk /dev/sdc: 1406.6 GB, 1406601789440 bytes
255 heads, 63 sectors/track, 171009 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1      171009  1373629761   83  Linux
Disk /dev/sdd: 1406.6 GB, 1406601789440 bytes
255 heads, 63 sectors/track, 171009 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1               1      171009  1373629761   83  Linux
 

OK. So I am pretty sure I can use sde as the new disk.
Do I need to run the mkfs now to create the sde1? Do you have the command exactly based on what my other disks look like?

Thanks for your help.

That's an interesting conclusion given that I don't see sde listed in there at all, and it should be! If it somehow missed it, try fdisk -l /dev/sde

RCWLO-ODS10g:~ # fdisk -l /dev/sde
RCWLO-ODS10g:~ #

Doesn't show up at all.
Again I will re-iterate I am not a unix admin. I still don't understand what I should be seeing when the new disk is presented to the server.

The sde shows up in:

 
RCWLO-ODS10g:/dev # ls sd*
sda  sda1  sda2  sda3  sda4  sdb  sdb1  sdb2  sdb3  sdc  sdc1  sdd  sdd1  sde
RCWLO-ODS10g:/dev #

I assumed the fdisk wouldn't report it until I have a partition set up on it?

It should show up no matter what. It might have a corrupt partition table or no partition table or a pre-existing partition table but it should at the very least show up and tell you what the disk's capacity is.

See if you can read from it. as root, dd if=/dev/sde of=/dev/null count=64. This is harmless.

I noticed before the reboot my SAN mount was on sde1 and now it is on sdd1 which I am not sure why.

 
RCWLO-ODS10g:/dev # dd if=/dev/sde of=/dev/null count=64
dd: opening `/dev/sde': No medium found
 

Thanks

That's not your new disk then, or if it is, something's wrong with it. dd doesn't care if the disk's been formatted.

Hmmmmmm. Since the reboot it seems that the disk mappings have changed and I'm not sure what the admin did for the new disk.

How about the sdc disk. It doesn't show up in the df -k.

I wouldn't trust that unless you were sure. Ask how large the disk was supposed to be, and look for an unused disk with that capacity.

I'll do that when he gets back.
Thanks for all your help.

I know this is an old post but I finally had a chance to run the scan script that was supplied and it stated there were no new devices to be found...

I do see the sdc as being 1.4 TB:

 
RCWLO-ODS10g:/dev # fdisk /dev/sdc
The number of cylinders for this disk is set to 171009.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)
Command (m for help): p
Disk /dev/sdc: 1406.6 GB, 1406601789440 bytes
255 heads, 63 sectors/track, 171009 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1      171009  1373629761   83  Linux

which is the size of the disk added but I don't see how I am supposed to mount it.

In the fstab the other disks are mounted with the /dev/disk/by-id/ but I do not know what I am supposed to do now to get this disk mounted.

RCWLO-ODS10g:/dev # ls -l /dev/disk/by-id/
total 0
lrwxrwxrwx 1 root root  9 Nov 27 08:01 edd-int13_dev80 -> ../../sda
lrwxrwxrwx 1 root root 10 Nov 27 08:01 edd-int13_dev80-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 Nov 27 08:01 edd-int13_dev80-part2 -> ../../sda2
lrwxrwxrwx 1 root root 10 Nov 27 08:01 edd-int13_dev80-part3 -> ../../sda3
lrwxrwxrwx 1 root root 10 Nov 27 08:01 edd-int13_dev80-part4 -> ../../sda4
lrwxrwxrwx 1 root root  9 Nov 27 08:01 edd-int13_dev81 -> ../../sdb
lrwxrwxrwx 1 root root 10 Nov 27 08:01 edd-int13_dev81-part1 -> ../../sdb1
lrwxrwxrwx 1 root root 10 Nov 27 08:01 edd-int13_dev81-part2 -> ../../sdb2
lrwxrwxrwx 1 root root 10 Nov 27 08:01 edd-int13_dev81-part3 -> ../../sdb3
lrwxrwxrwx 1 root root  9 Nov 27 08:01 scsi-3600508b4001046910000800001110000 -> ../../sdd
lrwxrwxrwx 1 root root 10 Nov 27 08:01 scsi-3600508b4001046910000800001110000-part1 -> ../../sdd1
lrwxrwxrwx 1 root root  9 Nov 27 08:01 scsi-3600508e0000000004d55ca66b1287901 -> ../../sda
lrwxrwxrwx 1 root root 10 Nov 27 08:01 scsi-3600508e0000000004d55ca66b1287901-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 Nov 27 08:01 scsi-3600508e0000000004d55ca66b1287901-part2 -> ../../sda2
lrwxrwxrwx 1 root root 10 Nov 27 08:01 scsi-3600508e0000000004d55ca66b1287901-part3 -> ../../sda3
lrwxrwxrwx 1 root root 10 Nov 27 08:01 scsi-3600508e0000000004d55ca66b1287901-part4 -> ../../sda4
lrwxrwxrwx 1 root root  9 Nov 27 08:01 scsi-3600508e000000000b855ee6ec6289509 -> ../../sdb
lrwxrwxrwx 1 root root 10 Nov 27 08:01 scsi-3600508e000000000b855ee6ec6289509-part1 -> ../../sdb1
lrwxrwxrwx 1 root root 10 Nov 27 08:01 scsi-3600508e000000000b855ee6ec6289509-part2 -> ../../sdb2
lrwxrwxrwx 1 root root 10 Nov 27 08:01 scsi-3600508e000000000b855ee6ec6289509-part3 -> ../../sdb3
lrwxrwxrwx 1 root root  9 Nov 27 08:02 usb-American_Megatrends_Inc._Virtual_Cdrom_Device -> ../../sr0
lrwxrwxrwx 1 root root  9 Nov 27 08:02 usb-American_Megatrends_Inc._Virtual_Floppy_Device -> ../../sde

Any help would be appreciated again.

Thanks

First, df -h to make sure it's not mounted anywhere already. The first column will show devices already mounted.

Then mount /dev/sdc1 /path/to/wherever/i/want/to/mount/it

If you want it to mount on boot you should put it in /etc/fstab

All the other entries all have the device by the

 
/dev/disk/by-id/scsi-3600508e000000000b855ee6ec6289509-part*

Is this going to cause issues if I add it referencing just the device name /dev/sdc ?

Thanks

---------- Post updated at 12:43 PM ---------- Previous update was at 11:45 AM ----------

K I think the sdc disk is a mirror for sdd. Mounted it and it contains exactly the same data.

The only other option I see is the sde disk in /dev/.
It's not mounted but when I do a fdisk /dev/sde it says:

 
RCWLO-ODS10g:/dev # fdisk /dev/sde
Unable to open /dev/sde

Not sure what my next step is now.

Thanks for all replies.

The installed hardware still isn't working for whatever reason. I really can't tell why from here but it's probably either driver or hardware related.