LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 04-24-2004, 11:08 AM   #1
sterrenkijker
Member
 
Registered: Mar 2004
Location: the Netherlands
Distribution: Debian Sarge
Posts: 302

Rep: Reputation: 31
/dev/zero


Goodevening,

I was wondering what exactly is the output of /dev/zero, because I'm having some partitioning problem: when I make a new windows partition my windows 98 SE doesn't see it right, it sees another windowspartition I have deleted some time ago, and a partition with zero size and no label (?). So I decided to put that part of my hard disk full of zero's with dd if=/dev/zero of=/dev/hda12, so windows 98 wouldn't get confused anymore. But it still does...

The former partitions were logical FAT32 partitions. I think the information of the former partitions is still on the disk, so windows still sees them.

My two questions:
- What does dd if=/dev/zero of=/dev/hda12 exactly?(I'd also like to know this cause I'm curious...)
- How can I prevent my windows from getting confused?

It's not really a critical problem for me, but I'd like to solve it. I want to compare the speed of FAT32, ext3 and reiserfs, but therefore I must have three partitions at around the same place on my harddisk. Just for fun, want to see it with my own eyes .

Sterrenkijker

Last edited by sterrenkijker; 04-24-2004 at 11:33 AM.
 
Old 04-24-2004, 05:12 PM   #2
ToniT
Senior Member
 
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
/dev/zero outputs zeroes. That is, bytes with all bits zeroed.

The 'dd if=/dev/zero of=/dev/hda12' zeroes the contents of the partition 12, so all data is swept away. Thus, it doesn't remove the partition itself. Information of the existence of the partition is primary located in the partition table at the start of the disk, so to get rid of all partitions in the disk you can 'dd if=/dev/zero of=/dev/hda bs=512 count=1' that will erase first 512 bytes from the disk (contains also boot loader).

In this case, when the partition number is 12, information of it's existence is not located in the partition table directly (it has only space for 4 partitions). Instead, primary partition table contains one extended partition that is located somewhere in the disk and in the begining of this extended partition there is the information of this partition.

Tools like cfdisk, fdisk or sfdisk can be used to manage partitions somewhat easier than with dd.
 
Old 04-24-2004, 06:21 PM   #3
sterrenkijker
Member
 
Registered: Mar 2004
Location: the Netherlands
Distribution: Debian Sarge
Posts: 302

Original Poster
Rep: Reputation: 31
Hi ToniT,

I won't reinstall everything or seriously risk losing data for it. My linux is installed on logical partitions... It looks like I have just zeroed the wrong part of my disk (thought logical partitions all had pointers to the next logical partition). Cfdisk didn't work for me, probably an incompatibility-issue with windows and linux. I think windows still finds information about that former windows partition, while linux ignores them.

Think I've got an idea, I'm gonna make a lot of logical linuxpartitions. That will probably overwrite the information about the windowspartitions...

Thanks for your information anyway, it got me some further...
 
Old 04-25-2004, 03:20 PM   #4
sterrenkijker
Member
 
Registered: Mar 2004
Location: the Netherlands
Distribution: Debian Sarge
Posts: 302

Original Poster
Rep: Reputation: 31
It didn't work . No effect at all...

Strange: it doesn't matter whether I make a primary or a logical windows partition: in both cases windows recognises an zero-size partition and the former 10 GB partition (it has the same label as that former partition). When I remove the new partition windows doesn't see them anymore. Really strange...

But thanks anyway.
 
Old 04-25-2004, 10:57 PM   #5
comp12345
Member
 
Registered: Feb 2004
Posts: 467

Rep: Reputation: 30
What is the output of "fdisk -l"? One possibility of why Windows is still seeing the partitions could be that you did not write the partition changes to the disk. If "fdisk -l" still shows the partitions, run "fdisk /dev/hda" then use d to delete the number partition you want to get rid of. Then use w to write the changes to disk. Be careful deleting the partitions, you don't want to delete the wrong one.
 
Old 04-30-2004, 02:52 AM   #6
sterrenkijker
Member
 
Registered: Mar 2004
Location: the Netherlands
Distribution: Debian Sarge
Posts: 302

Original Poster
Rep: Reputation: 31
Hi,

This is the output of fdisk -l:

debian:/home/stargazer# fdisk -l

Disk /dev/hda: 40.0 GB, 40020664320 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 319 2562336 b W95 FAT32
/dev/hda2 332 3205 23085405 f W95 Ext'd (LBA)
/dev/hda3 320 331 96390 83 Linux
/dev/hda5 332 1594 10145016 83 Linux
/dev/hda6 1595 1612 144553+ 82 Linux swap
/dev/hda7 1613 1916 2441848+ 83 Linux
/dev/hda8 1917 1965 393561 83 Linux
/dev/hda9 1966 1989 192748+ 83 Linux
/dev/hda10 1990 3205 9767488+ 83 Linux

Partition table entries are not in disk order
debian:/home/stargazer#

The 3th partition comes before the 2nd, for historical reasons .

-I've started making this table with dos fdisk, and made a primary partition and a logical partition for personal data (not present anymore), both fat32.

-After installing windows I've made some more partitions: hda6-9 for my linux...

-I have also made fat32 partitions after my linuxpartition, but that caused windows to recognise partitions I had deleted a long time ago already: before this partitiontable I had another one with too big logical fat32 partitions at the end of my disk.

-Recently I decided to move all the data of my fat32 to /dev/hda10, remove the fat32 partition, make a linuxpartition and move the data back. That partition wasn't mounted automatically when booting, so I made /dev/hda3 too. It may have solved the problem, it could have been a wrong line in /etc/fstab too... But that problem is solved now.

What I don't understand is why windows keeps seeing partitions that are already deleted. I hoped it would be a know problem or so. It looks like windows and linux store their partitiontables on another place on the disk. It's not the first time it happens to me. Maybe I just repartition too much .

Don't get in anymore...

Corien
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
I cannot access EITHER CD drive! And there's no /dev/hdc or /dev/hdd or /dev/cdrom! Dmalic Linux - Hardware 13 11-18-2005 07:11 PM
ln: creating symbolic link `/dev/dvd' to `/dev/hdc': Permission denied qazwsx27 Fedora 3 06-14-2005 02:09 PM
How can I boot either one of my hard drives /dev/hda or /dev/hdb, I have RH9 and FC2 omogunkristi Linux - General 1 06-21-2004 05:11 AM
Sandisk USB card Reader not linking /dev/sg0 to /dev/sda acidraven Linux - Hardware 1 06-19-2004 03:56 PM
mounting 2 ide-scsi devices /dev/cdrom and /dev/cdrom1 issue penguin123 Linux - Hardware 3 09-26-2003 08:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 02:21 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration