/dev/sdb1 100 MB ext2 /boot Will be mounted read-only
/dev/sdb2 2 GB swap swap
/dev/sdb3 Max. N/A N/A Extended partition, which contains other partitions
/dev/sdb5 15 GB ext3 / (root) Logical partitions start counting at 5
/dev/sdb6 Max. XFS /home All remaining space can be used for /home
It worked well and now I want to repartition the drive to have only one partition with ext4.
The problem is when I plug in the hdd, my openSUSE system’s partitioner (or fdisk) only recognizes the extended partition (/dev/sdb3 in the example). I realized this after I deleted this partition and made an ext4 partition.
Funny thing is that I can mount the 100m partition for /boot in openSUSE. So in Device Notifier, there are two partitions showing, but in fdisk or partitioner, only one is showing.
Another weird thing is that I cannot mount both partitions simultaneously. I have to unmount one to mount the other. When I mount the previous /boot partition, the boot files are still there.
How do I delete this? I think the 2GB partition for swap is there as well.
You could at least have posted an *fdisk -l *listing. Even if you think it is lousy. So far we have nothing but your word about all these things that happened, but not one line from the system confirming this.
BTW, as you want to delete all that is now on the disk (if I understand correct), why not use fdisk and it’s o command (create a new empty DOS partition table) and then start creating the one partition you want from there. (This is one step less drastic then erasing the first block of the disk with dd and then creating a new table).
do you see the difference? There’s something competely wrong with the partitioning of the disk, I’ve seen this on the flash memory cards I use to run LiveCD’s from. IIRC I removed the partition table, wrote zeros to the MBR sector of the device, or to the complete device. If you plug the disk in I bet you also see 2 devices.
I am not sure about the sequence of what you did. Did you first do the listings and then the o command? Or the other way around?
I offered you in post #2 a way to get rid of everything in the partition table.
You answer was the fdisk listing and a story about mounts. That brought me to the conclusion that you first want to understand what is going on and then, later, wanted, maybe, go for a solution. Thus my asking for more listings in post #4.
But now you are destroying all evidence by doing (only half it seems) what I suggested as repair.
Now please: is the listing before or after you did the o command (and I guess, but you must confirm, also the w command) in fdisk.
Remember that I can NOT look over your sholder, thus you MUST tell exactly, precise and in sequence what you are doing. Else we are loosing a lot of precious time and effort.
@GertJan,
When he did use the o and w commands with fdisk, it is correct what he shows, a disk with an empty table. When that is wat he did (first make an empty table and then look for the device special files) we will never know what the problem was. Sigh…
This is a weird thing going on. I first thought I bought bad microSD’s but four in a row, different brands should not be true. Recently I noticed this (I have one “damaged”):
Knurpht:~ # fdisk -l
(snipped /dev/sda, which is the internal SSD)
Disk /dev/sdb: 1967 MB, 1967128576 bytes
64 heads, 32 sectors/track, 1876 cylinders, total 3842048 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xd704f98b
Device Boot Start End Blocks Id System
/dev/sdb1 * 0 1423359 711680 83 Linux
/dev/sdb4 1423360 3842047 1209344 83 Linux
Disk /dev/sdb1: 728 MB, 728760320 bytes
64 heads, 32 sectors/track, 695 cylinders, total 1423360 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xd704f98b
Device Boot Start End Blocks Id System
/dev/sdb1p1 * 0 1423359 711680 83 Linux
/dev/sdb1p4 1423360 3842047 1209344 83 Linux
If I put the card in the card-reader, the device notifier gives me three entries: openSUSE Live CD twice, hybrid once. I investigated what was on the partitions, the content of an openSUSE KDE Live CD, plus a parition where AFAIK the /home of the user linux is created. Yet it looked as if a third partition was on the card. I tried this:
Knurpht:/ # mount /dev/sdb /mnt
mount: warning: /mnt seems to be mounted read-only.
and take a look what’s in /mnt:
Knurpht:/mnt # ls -l
total 678838
drwxr-xr-x 4 399 399 2048 Mar 2 2011 boot
-rw-r--r-- 1 399 399 101 Mar 2 2011 config.isoclient
-rw-r--r-- 1 399 399 695126037 Mar 2 2011 openSUSE-kde-11.4-livecd-kde-read-only.x86_64-2.8.0
-rw-r--r-- 1 399 399 566 Mar 2 2011 syslinux.cfg
Output is the same when I mount /dev/sdb1. I continued my experiment, removed the partitions, created a brand new empty partition table, rebooted to make sure the kernel wasn’t holding any wrong info, output:
Knurpht:/ # fdisk -l
Disk /dev/sda: 64.0 GB, 64023257088 bytes
255 heads, 63 sectors/track, 7783 cylinders, total 125045424 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x7eb9aff0
Device Boot Start End Blocks Id System
/dev/sda1 * 63 29366819 14683378+ 83 Linux
/dev/sda2 29366820 58364143 14498662 83 Linux
/dev/sda3 58364145 62573174 2104515 82 Linux swap / Solaris
/dev/sda4 62573175 125033894 31230360 83 Linux
Disk /dev/sdb: 1967 MB, 1967128576 bytes
61 heads, 62 sectors/track, 1015 cylinders, total 3842048 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x437b7e2d
Device Boot Start End Blocks Id System
Again, I attempt to mount /dev/sdb on /mnt, output:
Knurpht:/ # mount /dev/sdb /mnt
mount: warning: /mnt seems to be mounted read-only.
Knurpht:/ # cd /mnt
Knurpht:/mnt # ls -l
total 678838
drwxr-xr-x 4 399 399 2048 Mar 2 2011 boot
-rw-r--r-- 1 399 399 101 Mar 2 2011 config.isoclient
-rw-r--r-- 1 399 399 695126037 Mar 2 2011 openSUSE-kde-11.4-livecd-kde-read-only.x86_64-2.8.0
-rw-r--r-- 1 399 399 566 Mar 2 2011 syslinux.cfg
That’s not good, don’t understand what’s going on, and I was too busy to get into it at the time it was happening. But now I noticed the OP had a LiveCD on his disk, makes me curious what will be the outcome of mounting his /dev/sdb in /mnt and then look at the contents. No partition table to me means no files, no folders.
I’m sorry for the confusion. I did not say anything about your solution because I already said in my first post that I deleted all the partitions in fdisk and it did not work. I should have made it clear.
The listing I posted before was AFTER I did o command. I tried it again just in case.
Okay. Now I recreated a partition (160gb-ext4), with $ fdisk /dev/sdb, n, p, and default values. And the following is the output of fdisk -l (this time, whole thing) and ls -l /dev/sdb*, ls -l /dev/disk/by* | grep sdb.
linux-wqvr:/home/joon # fdisk -l
Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x3fd6ce01
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 208895 103424 83 Linux
/dev/sda2 208896 4401151 2096128 82 Linux swap / Solaris
/dev/sda3 4401152 1953523711 974561280 f W95 Ext'd (LBA)
/dev/sda5 4403200 56838143 26217472 83 Linux
/dev/sda6 56840192 1953503231 948331520 83 Linux
Disk /dev/sdc: 1000.2 GB, 1000202043392 bytes
255 heads, 63 sectors/track, 121600 cylinders, total 1953519616 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00021631
Device Boot Start End Blocks Id System
/dev/sdc1 2048 1321203711 660600832 7 HPFS/NTFS/exFAT
/dev/sdc2 1321203712 1953519615 316157952 83 Linux
Disk /dev/sdd: 1499.7 GB, 1499748892672 bytes
255 heads, 63 sectors/track, 182334 cylinders, total 2929197056 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xdf7cdbb3
Device Boot Start End Blocks Id System
/dev/sdd1 * 2048 206847 102400 7 HPFS/NTFS/exFAT
/dev/sdd2 206848 2929195007 1464494080 7 HPFS/NTFS/exFAT
Disk /dev/sdb: 160.0 GB, 160041885696 bytes
81 heads, 63 sectors/track, 61254 cylinders, total 312581808 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x1143fa85
Device Boot Start End Blocks Id System
/dev/sdb1 2048 312581807 156289880 83 Linux
This worked. I did that and created a partition in fdisk, and now there is only one partition to mount and the one was gone. Tried to write some files to the drive and it seems to be working well.
It just took a lot of time, I guess I could just wiped the master boot record (would $ dd if=/dev/zero of=/dev/sdb bs=446 count=1 work?) as well.
The dd was what I suggested also (and a count of 1 should be sufficint omho), but I do not understand why a new table (the o command) should not work on his own.
Still a bit of a mystery, but it works now. Concrats.