LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Enterprise (https://www.linuxquestions.org/questions/linux-enterprise-47/)
-   -   partition overlapping (https://www.linuxquestions.org/questions/linux-enterprise-47/partition-overlapping-527902/)

w-mar 02-12-2007 03:26 PM

partition overlapping
 
Hi,

I'm having issues with a discrepancy in the partition information for an external, 250GB USB hard-drive. I defined a device file (using 'mknod') for a second partition on a third external disk ('/dev/sdc2') since there was only one partition for a third disk available in the device files of my distro (RHE 4) and this is the third hard-disk on the machine that must be partitioned. After successfully doing that, I partitioned the drive into two 100GB parts (leaving some space for future expansion) using fdisk. I reviewed my partitions (within fdisk) and all looks fine and I wrote them. I then created filesystems on the partitions and mounted them. Using the "Hardware Browser" GUI in RHE Linux to check my work showed that I have two 100 GB partitions as I had wanted plus 50GB of free space as there should be.
So far so good.
Then when I use the 'df' command, I see that the space available for the first partition is 100% of the drive (250GB) and the second has 100GB of free space. Does anyone know why it appears that my partitions are overlapping?

Thanks in advance.

w-mar

Lenard 02-12-2007 04:13 PM

Please show us the output from the typed command;

fdisk -l /dev/sdc

FYI: do not use mknod to create hard drive devices. You have zero reason to.

Please read the manpages for fdisk and mkfs and if you have it installed gparted.

w-mar 02-13-2007 09:38 AM

I have actually found the solution to the problem. It turns out that within fdisk, I had to toggle off the "DOS compatibility mode" using command option 'c'. This fixed the overlapping partition problem entirely.

Although, now I'm curious Lenard: if I should not use mknod to create hard drive devices, how would I access a second partition on a third hard drive if there is no /dev/sdc2 device file already available?

Thanks.

w-mar

Lenard 02-13-2007 10:55 AM

They should be automatically created when the partitions are created/formatted and the system recognizes the new hard drive and partitions.

Again, please read/review the manpages for fdisk and mkfs. The system via udev/hal should pick up and add them, for example;

$ ls -al /dev/sdb*
ls: /dev/sdb*: No such file or directory

Attach the USB external hard drive to the system and look at the tail end of the /var/log/messages file (the drive is only 60-GB but shows the concept);

Code:

$ sudo tail /var/log/messages
Feb 13 11:47:28 Aspire5000 kernel: scsi 4:0:0:0: Direct-Access    WDC WD60 0VE-00KWT0      0811 PQ: 0 ANSI: 0
Feb 13 11:47:28 Aspire5000 kernel: SCSI device sdb: 117210240 512-byte hdwr sectors (60012 MB)
Feb 13 11:47:28 Aspire5000 kernel: sdb: test WP failed, assume Write Enabled
Feb 13 11:47:28 Aspire5000 kernel: sdb: assuming drive cache: write through
Feb 13 11:47:28 Aspire5000 kernel: SCSI device sdb: 117210240 512-byte hdwr sectors (60012 MB)
Feb 13 11:47:28 Aspire5000 kernel: sdb: test WP failed, assume Write Enabled
Feb 13 11:47:28 Aspire5000 kernel: sdb: assuming drive cache: write through
Feb 13 11:47:28 Aspire5000 kernel:  sdb: sdb1 sdb2 sdb3
Feb 13 11:47:28 Aspire5000 kernel: sd 4:0:0:0: Attached scsi disk sdb
Feb 13 11:47:28 Aspire5000 kernel: sd 4:0:0:0: Attached scsi generic sg2 type 0

Now the drive and partitions are available;

$ ls -al /dev/sdb*
brw-r----- 1 root disk 8, 16 Feb 13 11:47 /dev/sdb
brw-r----- 1 root disk 8, 17 Feb 13 11:47 /dev/sdb1
brw-r----- 1 root disk 8, 18 Feb 13 11:47 /dev/sdb2
brw-r----- 1 root disk 8, 19 Feb 13 11:47 /dev/sdb3

Is this not nice???


All times are GMT -5. The time now is 10:34 PM.