Mounting a new disk on linux server | Unix Linux Forums | Linux

  Go Back    


Linux RedHat, Ubuntu, SUSE, Fedora, Debian, Mandriva, Slackware, Gentoo linux, PCLinuxOS. All Linux questions here!

Mounting a new disk on linux server

Linux


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 11-22-2010
jamie_collins jamie_collins is offline
Registered User
 
Join Date: Nov 2009
Last Activity: 27 September 2011, 4:17 PM EDT
Posts: 52
Thanks: 1
Thanked 1 Time in 1 Post
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:


Code:
 
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


Code:
 
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



Code:
 
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
Sponsored Links
    #2  
Old 11-22-2010
dhzdh dhzdh is offline
Registered User
 
Join Date: Nov 2010
Last Activity: 27 November 2013, 3:00 PM EST
Location: Tel Aviv
Posts: 20
Thanks: 0
Thanked 1 Time in 1 Post
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)?
Sponsored Links
    #3  
Old 11-22-2010
jamie_collins jamie_collins is offline
Registered User
 
Join Date: Nov 2009
Last Activity: 27 September 2011, 4:17 PM EDT
Posts: 52
Thanks: 1
Thanked 1 Time in 1 Post
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:


Code:
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


Code:
 
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
    #4  
Old 11-22-2010
mark54g mark54g is offline Forum Advisor  
Registered User
 
Join Date: May 2008
Last Activity: 26 July 2013, 11:43 AM EDT
Location: Northeastern United States
Posts: 918
Thanks: 1
Thanked 61 Times in 58 Posts
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/res...si-bus.sh-1.25

or try this:


Code:
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

Code:
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.
Sponsored Links
    #5  
Old 11-24-2010
dhzdh dhzdh is offline
Registered User
 
Join Date: Nov 2010
Last Activity: 27 November 2013, 3:00 PM EST
Location: Tel Aviv
Posts: 20
Thanks: 0
Thanked 1 Time in 1 Post
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.
Sponsored Links
    #6  
Old 11-29-2010
jamie_collins jamie_collins is offline
Registered User
 
Join Date: Nov 2009
Last Activity: 27 September 2011, 4:17 PM EDT
Posts: 52
Thanks: 1
Thanked 1 Time in 1 Post
K we ended up needing to reboot the box anyway and now here is what I see:


Code:
 
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:


Code:
 
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:


Code:
 
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?
Sponsored Links
    #7  
Old 11-29-2010
Corona688 Corona688 is offline Forum Staff  
Mead Rotor
 
Join Date: Aug 2005
Last Activity: 17 April 2014, 6:29 PM EDT
Location: Saskatchewan
Posts: 18,531
Thanks: 681
Thanked 3,036 Times in 2,856 Posts
Run fdisk -l. It will show the capacities of the disks to help you pin it down more absolutely.
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Mounting a Raw Disk fahdmirza Solaris 3 07-21-2010 09:51 AM
Mounting SunSolaris Filesystem on Linux Ubuntu Server SkySmart UNIX for Advanced & Expert Users 4 05-25-2010 11:48 AM
mounting aix disk under different OS alex.blackbit AIX 1 07-19-2008 12:51 PM
IInd Hard Disk Mounting Problem on 1st HDD On SCO UNIX Open Server Niraj Gopal Sha Shell Programming and Scripting 0 06-18-2005 04:46 AM
Mounting second disk FattyLumpkin Filesystems, Disks and Memory 2 02-12-2002 04:36 AM



All times are GMT -4. The time now is 11:45 PM.