LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 06-18-2006, 10:53 AM   #1
air4time
Member
 
Registered: Aug 2004
Distribution: Slackware 10.2
Posts: 35

Rep: Reputation: 15
Fdisk..removed wrong partition...help please


This will be a long post sorry in advance.

I posted in newbie "http://www.linuxquestions.org/questions/showthread.php?p=2296327#post2296327"
and was told to try here for the rest of the problem.

Here is the last part"
" Mmmm - you create partitions from something like fdisk. I don't understand your use of {NO partition can be set to the "primary 2"}.
Just create partition(s), and let them create where they may. After a reboot, then you can attempt a mkfs on it."

Fdisk had no problem with putting it to primary 2 after reboot fdisk still showed everything as ok. But when I went to mkfs it complained about it not being a device block(or something like that) After I was able to put any where but primary 2 I looked into the /dev and seen "/dev/hdb2" was a directory but none of the other ones was. So I deleted the directory and rebooted. Then it said no such device(or something like that). I then deleted the partition with fdisk, rebooted then added again still no luck. My best guess is I did something to "/dev/hdb2" sometime and just now caught it. I need to know how to restore it.
"
If more info is needed please ask I did not want to repost everything since most is fixed.

Thanks Lonnie
 
Old 06-18-2006, 11:11 AM   #2
Randux
Senior Member
 
Registered: Feb 2006
Location: Siberia
Distribution: Slackware & Slamd64. What else is there?
Posts: 1,705

Rep: Reputation: 55
I can't understand from your writing what you did, what you wanted to happen, and what happened instead.

But, you do not have to make a filesystem to install Slackware.

Boot from the Slackware installation disc (disc 1 of 4) and go through the installer.

It will lead you through the partitioning (fdisking) step. Then it will ask you where you want to mount various filesystem points like root (/). You will have the option to build the filesystem you want under the installation dialog - let Slackware do this. You don't have to do this step outside the installation scripts or use any special commands unless you have a good reason.
 
Old 06-18-2006, 11:30 AM   #3
air4time
Member
 
Registered: Aug 2004
Distribution: Slackware 10.2
Posts: 35

Original Poster
Rep: Reputation: 15
Thanks Randux
"I can't understand from your writing what you did, what you wanted to happen, and what happened instead."
Sorry, I mistaking deleted a partition on my second drive and maded a new one and then rebooted. I was able to get the lost partition back using "testdisk" but could not put anything in the primary "2" spot. After many reboots and fdisks I discoverd that the "/dev/hdb2" was now in fact a dir not a "link"(guess that is what it is called" like the rest of them are. So I tried to deleted it and then reboots, more fdisks and shutdowns but still could not put anything in the "primary "2" spot or should I say I could in fact make the partition use primary "2" with fdisk but when I tried to format it using mkfs it complained and would not do it. That is when I found the "/dev/hdb2" problem. I even tried to rename "/dev/hdb20" to "/dev/hd2" but still mkfs complained. I have rebooted,shutdown, had 20 gig free, nothing seems to fix the corrupted "/dev/hdb2" problem. Fdisk never complained but mkfs did. I am assumming I missed up the /dev/hdb2 somehow so I need to fix it. Thanks hope this clears things up a little

Lonnie
Forgot to add I am using Linux ver 2.6.16.1

Last edited by air4time; 06-18-2006 at 11:31 AM.
 
Old 06-18-2006, 12:14 PM   #4
Randux
Senior Member
 
Registered: Feb 2006
Location: Siberia
Distribution: Slackware & Slamd64. What else is there?
Posts: 1,705

Rep: Reputation: 55
Hi Lonnie,

I'm sorry but because of the English I'm still not understanding you 100%.

Remember that the partition table is just like an index to your data on the disk- it is not the data itself.

So if you delete a partition or change the type, or do almost anything to the partition table, you can always change it back ...... if...... you didn't change the data on the disk and.....if you wrote down what you had in the partition table before or saved the output from fdisk.

If you have the information, you can restore the partition table by hand using fdisk. If you don't, you can try some recovery live CD, but I never used one.

It's important before you start fdisking to make backups of anything you can't afford to lose and do something like

Code:
 fdisk -l > myfdisk.txt
before you start. Then if you make any mistakes you can use the printout to help you fix it. Go slow and pay attention and it will be ok.

If you lost some data, search this forum for more info on recovering lost partitions. There are some threads.
 
Old 06-18-2006, 01:08 PM   #5
air4time
Member
 
Registered: Aug 2004
Distribution: Slackware 10.2
Posts: 35

Original Poster
Rep: Reputation: 15
Thanks for the help Randux

Look at this "http://www.linuxquestions.org/questions/showthread.php?p=2296327#post2296327"

It may help explain better. Thx for the "fdisk -l > myfdisk.txt" I will do that. I already recovered the partition and all data. I just can not figure out why I can not format a partition if it is using the primary 2 spot. Only thing I can figure is the "/dev/hdb2" is bad.

Look maybe this can help

root@dadslinux:/home/dad# ls -l /dev/hdb3
brw-rw---- 1 root disk 3, 67 2006-06-17 20:57 /dev/hdb3
root@dadslinux:/home/dad# ls -l /dev/hdb2
brw-rw---- 1 root disk 3, 84 2002-06-09 19:27 /dev/hdb2
root@dadslinux:/home/dad# ls -l /dev/hdb4
brw-rw---- 1 root disk 3, 68 2006-06-17 23:35 /dev/hdb4
root@dadslinux:/home/dad# ls -l /dev/hdb1
brw-rw---- 1 root disk 3, 65 2006-06-17 20:57 /dev/hdb1
maybe have something to do with 84?

Thanks Lonnie
 
Old 06-18-2006, 01:29 PM   #6
Randux
Senior Member
 
Registered: Feb 2006
Location: Siberia
Distribution: Slackware & Slamd64. What else is there?
Posts: 1,705

Rep: Reputation: 55
Lonnie if we need to look at the partition table please print the output from fdisk -l (run it as root). And use the # (code tags) around it so that it will line up so we can read it. And we'll try to understand. Thanks,Rand.
 
Old 06-18-2006, 01:55 PM   #7
air4time
Member
 
Registered: Aug 2004
Distribution: Slackware 10.2
Posts: 35

Original Poster
Rep: Reputation: 15
ok here it is

Code:
root@dadslinux:/home/dad# fdisk -l

Disk /dev/hda: 40.0 GB, 40020664832 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        1216     9767488+   c  W95 FAT32 (LBA)
/dev/hda2            1217        3587    19041074    5  Extended
/dev/hda3            3587        4400     6534406   83  Linux
/dev/hda5            1217        1600     3084448+  83  Linux
/dev/hda6            1601        1800     1606468+  83  Linux
/dev/hda7            1801        2294     3968023+  83  Linux
/dev/hda8            2295        2322      216184+  82  Linux swap
/dev/hda9            2322        2887     4535968+  83  Linux
/dev/hda10           2887        3161     2206594   83  Linux
/dev/hda11           3162        3586     3413781    b  W95 FAT32

Disk /dev/hdb: 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/hdb1   *           1        1912    15358108+  a5  FreeBSD
/dev/hdb3            3500        4865    10972395   83  Linux
/dev/hdb4            1913        3499    12747577+  83  Linux

Partition table entries are not in disk order
 
Old 06-18-2006, 02:02 PM   #8
Randux
Senior Member
 
Registered: Feb 2006
Location: Siberia
Distribution: Slackware & Slamd64. What else is there?
Posts: 1,705

Rep: Reputation: 55
Ok, now I can see what is happening.

You have your whole disk already defined. hdb1 goes from 1 to 1912, hdb4 goes from 1913 to 3499, and hdb3 goes from 3500 to 4865.

You don't have any more room on this disk. If this partition table is wrong, you can fix it by using fdisk. Delete the incorrect entry(s) and build new ones, write the partition table, and reboot.

If you don't know what the original values are, you will have to figure them out with some diagnostic tool, and I don't know how to help you. But people here have used that stuff.
 
Old 06-18-2006, 04:56 PM   #9
air4time
Member
 
Registered: Aug 2004
Distribution: Slackware 10.2
Posts: 35

Original Poster
Rep: Reputation: 15
Thanks for trying for some reason we are not on the same page. I can not put any partition on /dev/hdb2 no matter what. I tried at 10 times , at least 10 different ways,reboots and shutdowns after each, 20 gig free, with no other partitions, with other partitions, with just 2 partitions, it does not matter it will not allow me to format(mkfs) anything on /dev/hdb2 the other 3 prime( /dev/hdb1,/dev/hdb3 or /dev/hdb4 )is fine just not /dev/hdb2. Fdisk will put the partition on /dev/hdb2 but I can not access it then. Even when testdisk fixed the missing partition and put it on /dev/hd2 I could not access it.

/dev/hdb2 is corrupted some how. I need to find out how to fix that. Everything else is fine. I am just wanting to know for in case in the future I need to know. I had to put the second partition on /dev/hdb3 and I know there must be a better way.

Lonnie
 
Old 06-18-2006, 06:09 PM   #10
gbonvehi
Senior Member
 
Registered: Jun 2004
Location: Argentina (SR, LP)
Distribution: Slackware
Posts: 3,145

Rep: Reputation: 53
Make: ls -l /dev/hdb2 it should point to device 3 66. If it doesn't (in the other post you said you renamed hdb20 to it, which won't work) goto /dev and type: mknod hdb2 b 3 66

Edit: You should delete /dev/hdb2 first

Last edited by gbonvehi; 06-18-2006 at 06:23 PM.
 
Old 06-18-2006, 06:28 PM   #11
air4time
Member
 
Registered: Aug 2004
Distribution: Slackware 10.2
Posts: 35

Original Poster
Rep: Reputation: 15
Thanks gbonvehi

"mknod hdb2 b 3 66"
I think that will do it.

Lonnie
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Fdisk..removed wrong partition...help please air4time Linux - Newbie 11 06-17-2006 09:53 PM
removed the wrong package phek Linux - General 2 10-20-2004 04:40 AM
How do I partition on fdisk? Sa3atsky Slackware 4 09-10-2004 06:47 PM
newbie - removed partition accidentally kristalchimera Debian 6 07-12-2003 11:36 PM
New Linux Install removed secondary hard drive partition suderfield Linux - Newbie 7 06-26-2003 04:15 PM

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

All times are GMT -5. The time now is 02:48 PM.

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