LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Why new SCSI hard disk's partition table was reset after reboot? (https://www.linuxquestions.org/questions/linux-hardware-18/why-new-scsi-hard-disks-partition-table-was-reset-after-reboot-599933/)

linux94118 11-15-2007 03:53 PM

Why new SCSI hard disk's partition table was reset after reboot?
 
Hi,

I added new SCSI hard disk to my server but the server did not detect the HD.
I checked dmesg and it looks fine as below.
----------LOG---------------
SCSI device sdc: 585937500 512-byte hdwr sectors (300000 MB)
SCSI device sdc: drive cache: write back
/dev/scsi/host0/bus0/target2/lun0: p1
Attached scsi disk sdc at scsi0, channel 0, id 2, lun 0
----------LOG---------------

I check fdisk -l and then it shows sdc as below.

----------LOG---------------
[root@server1 root]# fdisk -l
Device Boot Start End Blocks Id System
/dev/sda1 * 1 1275 10241406 7 HPFS/NTFS
/dev/sda2 1276 2231 7679070 5 Extended
/dev/sda5 1276 1291 128488+ 83 Linux
/dev/sda6 1292 1552 2096451 82 Linux swap
/dev/sda7 1553 2231 5454036 83 Linux
Device Boot Start End Blocks Id System
/dev/sdb1 * 1 17847 143355996 83 Linux
----------LOG---------------


I checked /dev/sdb* and it has symboic link like this.

----------LOG---------------
[root@server1 root]# ls -la /dev/sdb*
/dev/sdb -> scsi/host0/bus0/target1/lun0/disc
/dev/sdb1 -> scsi/host0/bus0/target1/lun0/part1
----------LOG---------------

I checked /dev/sdc* and there were folders somehow..
----------LOG---------------
[root@server1 dev]# ls -la sdc*
sdc:
total 0
drwxr-xr-x 1 root root 0 Nov 15 05:16 ./
drwxr-xr-x 1 root root 0 Dec 31 1969 ../

sdc1:
total 0
drwxr-xr-x 1 root root 0 Nov 15 05:16 ./
drwxr-xr-x 1 root root 0 Dec 31 1969 ../
----------LOG---------------
I removed those /dev/sdc and /dev/sdc1 and add symbolic link then I could see them but after reboot the system /dev/sdc and /dev/sdc1 folder were created.

Any advice would be appreciated.

tredegar 11-16-2007 10:22 AM

Welcome to LQ!
I am guessing sdc is your new disk. Make sure before you format it!
Have you partitioned and formatted it after physically installing it?
Quote:

[root@server1 dev]# ls -la sdc*
sdc:
total 0
drwxr-xr-x 1 root root 0 Nov 15 05:16 ./
drwxr-xr-x 1 root root 0 Dec 31 1969 ../

sdc1:
total 0
drwxr-xr-x 1 root root 0 Nov 15 05:16 ./
drwxr-xr-x 1 root root 0 Dec 31 1969 ../
sdc is a reference to your whole disk
sdc1 is a reference to the first partition of sdc
Those files you see are just linux files, on your root filesystem. The file "." refers to "The current directory" the file ".." refers to the parent directory of the current one. All directories, even empty ones, have these two files.

Commands to think about:
fdisk /dev/sda to partition it.
mkfs.ext3 -j /dev/sdc1 to format it.
Then you'll need to make sure it is mounted at boottime, by adding an entry to /etc/fstab. There are loads of threads about this on this board, just use the [SEARCH] button on this page.
Come back here if you have specific problems, and please update your profile so it lists what distro you are using (because they are all a little bit different)

Electro 11-16-2007 09:58 PM

If you just added a SCSI drive to the computer while it is on, you will have to tell Linux to add a device or rescan the luns. You can use cdrecord -scanbus or other utilities to do this.

Do not format raw devices. Format the partitions. If you do not want to reboot after you create the partitions, use hdparm -z to rescan the partition table on the desire drive. Then you can format the partitions. It is best to format partitions with labels.


All times are GMT -5. The time now is 12:22 PM.