LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Oh-no-what did I do?1 (https://www.linuxquestions.org/questions/linux-newbie-8/oh-no-what-did-i-do-1-a-712203/)

linus72 03-17-2009 04:54 AM

Oh-no-what did I do?1
 
Trying to re-install Slack on my laptop last night. Problems with USB CDROM during install-slackware install corrupted-after reboot to try again--typed "setup", then "no partitions found-use cfdisk".
??I had just formatted it EXT3 before!
Anyway-says the block size is 8094-should be 1024-says there's overlapping partitions.
Used fdisk to delete and make new partitions, thrn cfdisk-still screwed up...What can I do?

Didier Spaier 03-17-2009 05:52 AM

I would try to zero the beginning of the disk:
Code:

dd if=/dev/zero of=/dev/the_disk_to_be_formatted bs=512 count=1000
Of course I suppose that you have no valuable data on this disk and you know what will happen if you type a wrong device name. Anyway, triple check your command before hitting the 'Return' key ;)

Afterward proceed with fdisk as usual.

PS Please be patient while dd is running.

linus72 03-17-2009 06:16 AM

OK-it's only got a 4GB HD-so I want to wipe it and somehow restore whatever is the best layout-somehow something went wrong-'cause after booting up slack via usb-I logged in, typed setup and "no partitions on HD-use fdisk/cfdisk.
typed cfdisk-error-no partitions-unknown partitions.
typed fdisk /dev/hda
partitions=1-4??(should only be 2-hda1/ and hda2/swap.
anyway, tried to figure out what the defaults should be-cylinders, sectors, etc-I don't know the defaults??
Will "dd if=/dev/zero of=/dev/hda bs=512 count=1000"
fix it to the defaults it should be at?
I really don't know how this happened-this was a third re-install of Slack12.2-trying to install a minimal system-(4GB HD & 160MB RAM).
I didn't partition anything, just re-formatted EXT3 for each partition(2).
It keeps saying the "block" size is out of whack-hopefully dd will fix it.
Thanks-I'm not at home now-will be soon-then I'll see what can be done-Should've never removed Slack!

Didier Spaier 03-17-2009 07:02 AM

OK there come your nano how-to.

Let's suppose your disk's name be /dev/hda.

Type:
Code:

dd if=/dev/zero of=/dev/hda bs=512 count=1000
Then launch fdisk in interactive mode:
Code:

fdisk /dev/hda
Do not worry for the warnings, but type following commands at fdisk's prompt -- of course do not type anything from the # character (my explanations):
Code:

n # to create a new partition. By default type 83 (Linux)
p # it will be a primary partition
1 # it will be partition number 1 (max 4 primary partitions)
(hit return or type 1) # accept 1 as the default for first cylinder's number
3500M # the size of the partition
n # to create your second (swap) partition
p # primary partition again
2 # will be partition number two
(hit return) # accept the proposed first cylinder
(hit return) # accept the proposed last cylinder
t # to change the partition type for the swap
2 # to tell you want to change the second partition's type
L # to list the partition types, if you wish (optional)
82 # choose Linux-swap
p # to see the partition table before writing it on the disk if you wish (optional)
w # to write the partition table on the disk

Do not forget the last command, otherwise nothing will be physically written on the media.

In short you will have created two partitions and will be using:
- the first one (3500 megabytes) for /
- the second one (remaining space on the disk) for swap.

With such a layout you optimize space's usage, which is useful as you only have 4 GB available. It is not necessary to have /home on a separate partition. Of course even so you won't be able to install everything.

SlowCoder 03-17-2009 07:11 AM

While your posts-are-readable, it's kind-of hard-to-read them because of all-the-dashes you typed-in. They look reminiscent of command-line-options and make things a little-bit-confusing. :confused:

linus72 03-17-2009 07:26 AM

OUTPUT of fdisk /dev/hda after I did dd if=/dev/zero of=/dev/hda bs=512 count=1000-
Code:

Device contains neither a valid DOS partition table,
 nor Sun, SGI, or OSF disklabel
Building a new DOS disklabel.
Changes will remain in memory only,
until you decide to write them.

Number of cylinders for this disk
is set to 8994.
There is nothing wrong with that,
but this is larger than 1024,
and could in certain setups cause problems with-
1-software that runs at boot-eg-old LILO
2-booting and partitioning software from
other OS's-eg-DOS fdisk, OS/2 fdisk
Warning-invalid flag 0x0000 of partition
table 4 will be corrected by write

So, what do I do now-I have not yet written to disk...?

Didier Spaier 03-17-2009 08:11 AM

This is an usual warning which shows no problem. Use fdisk as indicated in my last post.

PS I just tried with an USB stick; same warning: everything went fine.

linus72 03-17-2009 08:14 AM

OK-maybe it worked?
I tried to change the default from 8994 to 1024-didn't seem to take after writing to disk-even after reboot.
It also says I have 62 unallocated sectors-what does that mean?

Didier Spaier 03-17-2009 08:25 AM

You do not have to - nor can you anyway - change 8994 to 1024: 8994 is proportional to the space on your disk. Do you really think that 4G is too much ?

62 unallocated (understand: not used) sectors is no big deal; do not worry about that.

Just to make sure, send the ouptut of 'fdisk -l'.

linus72 03-17-2009 08:37 AM

Thanks for the help!
I am finishing up the Slackware (lite) 12.2 install now on the little 4GB HD.
As soon as it finishes I will post the output of fdisk -l

linus72 03-17-2009 09:11 AM

OK-installed slackware 12.2 after following your directions-went fine
output of fdisk -l
Code:

Disk /dev/hda: 4327 MB, 4327464960 bytes
15 heads, 63 sectors/track, 8944 cylinders
Units = cylinders of 945 * 512 = 483840 bytes
Disk identifier: 0x72829cfb

  Device Boot      Start        End      Blocks  Id  System
/dev/hda1  *          1        8205    3876862  83  Linux
/dev/hda2            8206        8944      349177+  82  Linux swap

Dose that look ok?
here is free -m after swapon -a in KDE-running seamonkey and superterminal-
Code:

root@b:~# free -m
            total      used      free    shared    buffers    cached
Mem:          149        144          4          0          3        60
-/+ buffers/cache:        79        69
Swap:          340          0        340

here is dh -f
Code:

root@b:~# dh -f
-su: dh: command not found
root@b:~# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/root            3.7G  2.4G  1.1G  69% /
tmpfs                  75M    0  75M  0% /dev/shm

as soon as I get rid of KDS/XFCE4-then it'll be better-don't really know how to configure fluxbox yet-so kde/xfce4 are training wheels till then.
Any idea why no swap is being used??

Didier Spaier 03-17-2009 09:42 AM

Quote:

Originally Posted by linus72 (Post 3478275)
OK-installed slackware 12.2 after following your directions-went fine
output of fdisk -l

...

Dose that look ok?

Yes.


Quote:

Originally Posted by linus72 (Post 3478275)
Any idea why no swap is being used??

Simply because everything -- system + applications -- fit in RAM, so there is no need to put any live data on the disk. Keep in mind that swap space on disk is only used by the system if/when there is no more space available in RAM.

Obviously beeing able to keep everything in RAM is preferable, as input/output from/to disk are way slower than from/to RAM. This is why if you have a slow system, adding more RAM is usually the best bet to speed it up.

Hopefully systems based on Linux are usually not as memory hungry as other systems ;)

Didier Spaier 03-17-2009 09:52 AM

Configuring fluxbox is easy.

In a pinch: you only have to edit a few files in ~/.fluxbox directory.

And among other resources on http://fluxbox.org they have a good wiki, with many howtos.


All times are GMT -5. The time now is 06:09 PM.