LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 03-21-2004, 11:57 PM   #1
icehenge
Member
 
Registered: Jan 2004
Location: Tennessee
Distribution: Slackware 8.1 (KDE 3.0.1)
Posts: 69

Rep: Reputation: 15
free space partition creation & MBR question


Hello
I've got free space on my hard drive that is not allocated to a parition and I'd like
to partition that space and use it. I've just came from the DOS world and modifying
partitions on an occupied drives worries me some what. I'm using cfdisk in slackware,
can I just create a new partition with the free space, save the table and reboot and
all should be well? As in my system won't get trashed.


Also, second question. I'm wondering is their a way to backup a MBR record with a
slackware command? My system is setup as a dual boot ( windows98). Windows
won't be used anymore as I'm slowly getting everything working in slack so their will
be no need for windows I'm just worried i'm going to make some change and
loose all my hard work. I'm keeping a notebook now on how I got things working so
I won't have to start from scratch and re-research everything if I bomb the system.
Any thoughts on this rant?
 
Old 03-22-2004, 12:21 AM   #2
rootyard
Member
 
Registered: Aug 2003
Posts: 167

Rep: Reputation: 30
Your first question: create the paritition and then reformat it. You can then mount it where you want it and use it.

You can't really backup MBR. Are you using Lilo or Grub to boot? Either way, go into the config file for booting and erase the Windows entry.

Don't keep a notebook with pen and paper.
 
Old 03-22-2004, 02:54 AM   #3
motub
Senior Member
 
Registered: Sep 2003
Location: The Netherlands
Distribution: Gentoo (main); SuSE 9.3 (fallback)
Posts: 1,607

Rep: Reputation: 46
Even if you did "make some change and lose all (your) hard work", I must inform you that[list=1][*]backing up the MBR probably wouldn't make much difference (since the MBR and the second stage bootloader only control what operating systems are listed as available to boot and the information needed to boot them-- not the actual data contained on the partitions. So if your change somehow messed up the MBR, your only problem would be that one or both OSes would be inaccessible, not destroyed or damaged.[*]Much more useful, imo, would be a Live CD such as Knoppix, Mepis or SLAX. In case you actually do mess up system files, you can boot a Live CD, mount the affected partition, and make whatever adjustments are necessary. You can even chroot to the partition (assuming it's the Slack partition; I wouldn't chroot to a Win 98 partition ) and make adjustments as if the system was actually running.[*]It's really hard to "break" Slack. I've been "trying" for a month now, I've done stuff that definitely would have broken Mandrake and most likely Debian as well (since some of these things certainly have broken both distros for me in the past), and the thing is like a draft horse. It just doesn't break, apparently. So I wouldn't worry so much (as long as you have a LiveCD to boot to).[/list=1]
I think the notebook is a good idea, if that's a good learning method for you .
 
Old 03-22-2004, 03:17 AM   #4
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
Is the freespace inside an extended partition?
What does your partition table look like now?
I've had best results by creating an extended partition under windows and then under linux creating the linux partitions there. Windows doesn't really like to see more than one primary partition- it'll usually will work but since DOS fdisk won't let you do that it's better to not. Windows can recognize them but DOS can't
You can always restore your MBR with a w98 bootdisk by doing 'fdisk /MBR'
When you run lilo it will backup the MBR anyway. You can reinstall it by doing 'lilo -u'
Lilo will install fine though and let you dual boot easily. Still I usually install lilo to a floppy at least at first. Also before installing lilo runit like this:
'lilo -v -t' which will give you a verbose test of the lilo installation. If all is well then run 'lilo' to actually install it.
i still dual boot with w98 as I find it easier to do some things in w98. See my howto to find out how to 'Kill Bill'. This is a way to boot linux by double-clicking a shortcut on the windows desktop (using loadlin). It's worth booting into windows just to click on that, see the screen go blank, and then see "Loading Linux"...
 
Old 03-22-2004, 08:45 AM   #5
aus9
LQ 5k Club
 
Registered: Oct 2003
Location: Western Australia
Distribution: Icewm
Posts: 5,842

Rep: Reputation: Disabled
there are a number of ways to back up your mbr if you wish

(disk dump) command requires su (or root privilege)

dd if=/dev/hda of=/my backup folder/filename bs=512 count=1
or if scsi
change the hda to sda etc

2) use knoppix cd as already suggested but go for console mode only to be faster and use the partimage application to take any image of any partition on your first drive...it will save your mbr

I haven't tested it but if you image a partition on your second drive it may save the second drive's mbr but not sure.

3) as the mbr is only 512 bytes a floppy is an ideal backup media
 
Old 03-22-2004, 06:34 PM   #6
icehenge
Member
 
Registered: Jan 2004
Location: Tennessee
Distribution: Slackware 8.1 (KDE 3.0.1)
Posts: 69

Original Poster
Rep: Reputation: 15
Thanks for all the comments. I've made some good notes
Here are my reason I've a bit frighten of MBR or other hard disk troubles.
http://www.linuxquestions.org/questi...hreadid=140535
And
http://www.linuxquestions.org/questi...hreadid=159221

As you can see by those two threads I'd like to know how to 'fix' these troubles
by proper recovery/backup.. The hard drive is a Western Digital 60Gigabyte
drive thats is only 6months old, so I don't think my trouble is stemming from a bad
drive, at least I hope not. I know doing a complete backup of the disk is a solution
but since i've had a super block error and partition error in the past i'd like to know
if there is a way to backup this data where these problems are stemming from....


By the way I'm using LNX BBC as a rescue disk right now but I'll download
Knoppix and give that a try also since it has great recommendations here.

aus9: thank you. I backup the mbr with the command you type here.
Can you tell me how I would properly restore the MBR if I ever
needed to with my backup copy?


Also here is my partition setup for reference to the questions.
Disk Drive: /dev/hda
Size: 60022480896 bytes, 60.0 GB
Heads: 240 Sectors per Track: 63 Cylinders: 7753

Name Flags Part Type FS Type Size (MB)
---------------------------------------------------------------------------
hda1 Boot Primary Win95 FAT32 7764.67 /win98
hda5 Logical Linux ext2 193.54 /boot
hda6 Logical Linux swap 518.68 SWAP
hda7 Logical Linux ext2 4257.80 /
hda8 Logical Linux ext2 26483.47 home
hda9 Logical Linux ext2 1501.84 /var
Pri/Log Free Space 19299.41


Alex
 
Old 03-22-2004, 10:23 PM   #7
aus9
LQ 5k Club
 
Registered: Oct 2003
Location: Western Australia
Distribution: Icewm
Posts: 5,842

Rep: Reputation: Disabled
ok

I have seen your other posts and will rudely say, you have a partition tool error coupled to the use of lilo and interfered with by microsoft writing to mbr.

I may be wrong but will reply to the other posts when I study them better.

lets move on.

1) assume you want to backup/restore mbr

backup
dd if=/dev/hda of=/dev/fd0 bs=512 count=1

comments fd(zero) not o as in oh
dd --help for some help
you may have to mount your floppy depending on how you config'd

restore
dd if=/dev/fd0 of=/dev/hda bs=512 count=1

WARNINGS
I use partimage so making a typo with the floppy technique could really cause you some angst.

Can you hang five on testing this until myself or others fix your other posts.

I might be out of order again but I think your mbr is corrupted, there are two tables in mbr and me thinks one is gone haywire.

2) partimage has some dox on partition table here
http://www.partimage.org/doc/index-3.html#ss3.7

3) I went looking for the mbr save and restore for partimage but my fumbling brain can't find it, if you download it I will do a separate post.
 
Old 03-22-2004, 11:04 PM   #8
icehenge
Member
 
Registered: Jan 2004
Location: Tennessee
Distribution: Slackware 8.1 (KDE 3.0.1)
Posts: 69

Original Poster
Rep: Reputation: 15
aus9,
Thanks for taking the time to explain how to restore the mbr from a backup.

There is no real need to figure out my previous post unless you feel like figuring
it out . I've moved on after I did no receive a way to fix the trouble. I no longer
NEED an answer to those question although i'd like to know what went wrong.
Here are the details on the two post I talked about. As I type this i'm using the
computer that had all the trouble so it is working great now.

[Regarding this post
http://www.linuxquestions.org/questi...hreadid=140535
I could not get the system fixed so I went and wiped the drive. I know you might
think, Ge why do that? The reason I went and wiped the drive was because the
system was basicly a test install on this new machine. Since I could not resolve
the issue I had no tears about wiping the drive.

This second post:
http://www.linuxquestions.org/questi...hreadid=159221
That problem has not happened again and I think the partition check
hanging was a issue of overheating. One of the fans in the case failed a few days
earlier and I think that might have to do with the trouble as I could not reproduce
the trouble.]

I will do some reading now on partimage it sounds like a useful tool for backups.
Thanks for the assistance
Alex
 
Old 03-23-2004, 01:54 AM   #9
icehenge
Member
 
Registered: Jan 2004
Location: Tennessee
Distribution: Slackware 8.1 (KDE 3.0.1)
Posts: 69

Original Poster
Rep: Reputation: 15
Aus9,
At the time of my last post to this thread I did not know you'd replied to my other thread regarding
the super block trouble. Please disregard some of my comments. Partimage is very interesting,
i've still got a lot more reading on it though. Thanks for mentioning it.
 
Old 03-23-2004, 01:56 AM   #10
motub
Senior Member
 
Registered: Sep 2003
Location: The Netherlands
Distribution: Gentoo (main); SuSE 9.3 (fallback)
Posts: 1,607

Rep: Reputation: 46
Yes, from what I can see from the first thread (bad superblock), aus9 is more or less correct imo. What I would have suggested (had I not been asleep), or what I would have done had I had this problem would have been to run cfdisk and not do anything but rewrite the existing partition table to disk, then run 'lilo' to reinstall LiLO's settings. Can't guarantee that it would have worked, but afaik, the problem was because you changed the partition table after LiLO was installed.

LiLO, like every other boot loader, uses the partition table to "mark" (for want of a better or more precise/accurate word) where the partitions it needs to refer to are located (meaning start and end blocks, etc.), or so it appears to me (those more knowledgeable about this process may certainly expand or correct here). Changing the partition table without telling LiLO that it has changed (by running lilo to let it reread the settings and check that it knows where everything is) is bound to end in distress, because nothing is where LiLO thinks it should be and it's a bit obsessive that way .

But OK, you've wiped the drive, so it's a moot point (until you do something similar in a different situation . You probably will. We mostly all do ).

And the second problem solved itself, so we won't worry about that (unless it happens again).

So there's really no point to this reply other than to say (again) that I think that worrying about the MBR/partition table per se is a less-than-ideal starting point. What you need to be worried about is (imo, naturally) the accessibility of your data, which is not the same as accessibility of the OS, which is what the MBR controls (mostly). The OS doesn't matter. The OS can be reinstalled, and so can apps. Data matters. Lost data means lost work, lost save games, lost mail, lost irreplaceable information.

We know that partition tables can get borked. Most definitely under Win98. Since Win98 and Linux are now gently tied together (by LiLO, and /etc/fstab), borking the partition table of one can affect the other. So if I was you, I'd be much more interested in reducing the chance to hit the partition my data was on than being able to restore a partition table that most likely borked my data when it went down in the first place (FAT tables, you know?). And that means getting the data off the partiition most likely to get borked -- and that's the Win 98 C:\ drive. So get your data on another partition. It also means putting Linux data on a partition fs not so likely to get borked-- and that means using at least ext3 (and above) rather than ext2, for the journalling, which will recover the journal of your data's locations on the partition, so even after a power outage or hard reboot, your data will most likely be OK.

Having your data elsewhere means that even if you can't boot the OS, you can boot from a Live CD or rescue CD and mount your data partition (which is probably ok, short of a full catastrophic HDD failure, rather than the many things that might make an OS unbootable) and find the address you need, or print out your CV, or back up important files to somewhere. It also makes it somewhat easier to back up your data, since it's in a more centralized location than what is standard under Windows.

Maybe it's me, but while I naturally prefer (vastly) that my OSes boot normally, I don't so much care if they do, because even if they don't (short of the aforementioned catastrophic hardware failure, for which there is no preventative but good backups and ready cash), it doesn't mean that I have to stop everything until it's fixed, which can be a real problem if I needed a fast copy of my resume for a surprise interview that I have to leave for in 10 minutes when my PC crashed on me.

And so it seems to me that this whole "backup the partition table" thing is a side point, rather than an essential one, rather like making certain that you could retrieve your jewelry if your house burned down, without first making sure that you yourself had a clear path out to save your life.

But maybe I'm missing something. Just my 0.17 eurocents, anyway.
 
Old 03-23-2004, 02:57 AM   #11
icehenge
Member
 
Registered: Jan 2004
Location: Tennessee
Distribution: Slackware 8.1 (KDE 3.0.1)
Posts: 69

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by motub
Yes, from what I can see from the first thread (bad superblock), aus9 is more or less correct imo. What I would have suggested (had I not been asleep), or what I would have done had I had this problem would have been to run cfdisk and not do anything but rewrite the existing partition table to disk, then run 'lilo' to reinstall LiLO's settings. Can't guarantee that it would have worked, but afaik, the problem was because you changed the partition table after LiLO was installed.

LiLO, like every other boot loader, uses the partition table to "mark" (for want of a better or more precise/accurate word) where the partitions it needs to refer to are located (meaning start and end blocks, etc.), or so it appears to me (those more knowledgeable about this process may certainly expand or correct here). Changing the partition table without telling LiLO that it has changed (by running lilo to let it reread the settings and check that it knows where everything is) is bound to end in distress, because nothing is where LiLO thinks it should be and it's a bit obsessive that way .

But OK, you've wiped the drive, so it's a moot point (until you do something similar in a different situation . You probably will. We mostly all do ).

Hi, Thanks for the help.
Rewriting the partition table with cfdisk is a good but it didn't work at the time, at least by my
method. As far as I remember I booted with my live rescue CD at the time and tried
doing 'cfdisk /dev/hda'
And I got and error "fatal error, bat primary partition O: partion ends before sector 0"
So by what I was doing I could not rewrite the table, unless I did not know the right
switch. I never did try the DOS command 'fdisk /mbr' , I'd read somewhere that it could
really mess up the drive. Although i'd used it before on DOS/Windows based systems
without trouble. Besides having a copy of this info which I didn't have at the time:

---Starting--- ----Ending---- Start Number of
# Flags Head Sect Cyl ID Head Sect Cyl Sector Sectors
-- ----- ---- ---- ---- ---- ---- ---- ---- -------- ---------
1 0x80 1 1 0 0x0B 239 63 1002 63 15165297
2 0x00 0 1 1003 0x05 239 63 1023 15165360 64365840
3 0x00 0 0 0 0x00 0 0 0 0 0
4 0x00 0 0 0 0x00 0 0 0 0 0
5 0x00 1 1 1003 0x83 239 63 1023 63 377937
6 0x00 239 63 1023 0x82 239 63 1023 63 1012977
7 0x00 239 63 1023 0x83 239 63 1023 63 8315937
8 0x00 239 63 1023 0x83 239 63 1023 63 51725457
9 0x00 239 63 1023 0x83 239 63 1023 63 2933217


As you mentioned ext3 does sound appealing now
Is their another solution to recreating the partition table, or a solution to
accessing the data. I just couldn't mount the partition.




Quote:
And so it seems to me that this whole "backup the partition table" thing is a side point, rather than an essential one, rather like making certain that you could retrieve your jewelry if your house burned down, without first making sure that you yourself had a clear path out to save your life.

But maybe I'm missing something. Just my 0.17 eurocents, anyway.
You're correct, and thanks for mentioning that. I was sort of wondering in the wrong
direction their as I tend to loose focus. The thing is I could not access my data so my
thinking is I wish i'd had a backup partition table it might have helped, maybe.

OK, time for some sleep,
 
Old 03-23-2004, 07:21 AM   #12
aus9
LQ 5k Club
 
Registered: Oct 2003
Location: Western Australia
Distribution: Icewm
Posts: 5,842

Rep: Reputation: Disabled
well I can see this post is basically dead so its time to be rude again,
trick 1 with partimage is
mount -t auto /dev/hdax /mnt
the auto tries ext2 ext3 etc until it finds the correct file system format but I don't think it handles the JFS XFS or other types

i use reiserfs which rivals ext3 for journal attributes and is reputed to be better for lots of little files, have a look at how many you have , heh heh

Anyone I can convert to partimage is better looking smarter and younger than me.

end of my tracking this post
 
Old 03-23-2004, 07:37 AM   #13
motub
Senior Member
 
Registered: Sep 2003
Location: The Netherlands
Distribution: Gentoo (main); SuSE 9.3 (fallback)
Posts: 1,607

Rep: Reputation: 46
Only downside to ReiserFS is that you can't read it from Windows (should you need to) using Explore2fs. Otherwise I'd use it over ext3 as well.

Thanks for the partimage tip.
 
Old 03-23-2004, 07:54 PM   #14
icehenge
Member
 
Registered: Jan 2004
Location: Tennessee
Distribution: Slackware 8.1 (KDE 3.0.1)
Posts: 69

Original Poster
Rep: Reputation: 15
That was a good discussion. Thanks for hearing me.
I've got a much better understand now and I appreciate both your time.

Last edited by icehenge; 03-23-2004 at 07:55 PM.
 
  


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
partition used/free space elbriga Linux - General 2 09-24-2004 12:36 PM
How do I check free partition space explorer Linux - General 5 04-14-2004 12:35 PM
Formating free space: WinXP pro and RH9 dualboot with free space on 3rd drive Vermicious Linux - General 2 03-22-2004 05:10 AM
Partition Free Space - Move /home to the new partition gregkise Linux - General 5 12-16-2003 10:19 PM
Partition Free Space? Gerardoj Linux - General 16 06-02-2003 01:16 AM

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

All times are GMT -5. The time now is 09:51 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