LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-18-2003, 07:17 PM   #1
lectraplayer
Member
 
Registered: Mar 2003
Location: a little west of Birmingham, AL, USA.
Distribution: Porteus 3.1
Posts: 934

Rep: Reputation: 32
How do I format a hard disk under console?


What command do I use to format a hard disk under Linux console? I already have it partitioned.
 
Old 03-18-2003, 07:35 PM   #2
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
For a linux ext2 filesystem use this command

Code:
mke2fs /dev/hd??
hd?? = your partition

the first partition on the primary master ide will be hda1
the second will be hda2
the first partition on the primary slave will be hdb1
the first partition on the secondary master will be hdc1
the first partition on the secondary slave will be hdd1
and so on

note that extended partitions will be assigned a partition number and will change the sequence for logical drives depending on where the extended partition is.

To view partitions use fdisk -l

example

fdisk -l

Disk /dev/hda: 255 heads, 63 sectors, 7296 cylinders
Units = cylinders of 16065 * 512 bytes

Device Boot Start End Blocks Id System
/dev/hda1 1 141 1132551 a0 IBM Thinkpad hibernation
/dev/hda2 * 142 5878 46082452+ 7 HPFS/NTFS
/dev/hda3 5879 6009 1052257+ 82 Linux swap
/dev/hda4 6010 7296 10337827+ f Win95 Ext'd (LBA)
/dev/hda5 6010 7296 10337796 83 Linux



to convert it to ext3 use this command

Code:
tune2fs -j /dev/hd??

Last edited by DavidPhillips; 03-18-2003 at 07:39 PM.
 
Old 03-18-2003, 07:38 PM   #3
lectraplayer
Member
 
Registered: Mar 2003
Location: a little west of Birmingham, AL, USA.
Distribution: Porteus 3.1
Posts: 934

Original Poster
Rep: Reputation: 32
So go mke2fs /dev/hda1 huh?
 
Old 03-18-2003, 07:41 PM   #4
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
if it's the primary master first partition, yes
 
Old 03-18-2003, 07:50 PM   #5
lectraplayer
Member
 
Registered: Mar 2003
Location: a little west of Birmingham, AL, USA.
Distribution: Porteus 3.1
Posts: 934

Original Poster
Rep: Reputation: 32
OK, I got it formatted. What's the best way to transfer Linux to my hard disk? ...or will that take an install. I bet it will take an install that I'll do later.
 
Old 03-18-2003, 08:07 PM   #6
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
Is it a running linux system?

If you can boot into the system with a root/boot disk it will be best. If not then you want to skip copying the /proc folder. If you have devfs then also exclude the /dev/folder on your running system


I would use tar


mkdir newdrive

mount /dev/hda1 /newdrive

cd /
tar -cv . --exclude ./proc --exclude ./newdrive | (cd /newdrive; tar -xv)


mkdir /newdrive/proc

Last edited by DavidPhillips; 03-18-2003 at 08:16 PM.
 
Old 03-18-2003, 08:13 PM   #7
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
/newdrive/etc/fstab will need to be setup correctly

/newdrive/etc/lilo.conf will need to be setup correctly

you will need to install lilo using the new systems lilo.conf

use caution here, know what your doing
chroot /newdrive; lilo
 
Old 03-18-2003, 08:16 PM   #8
lectraplayer
Member
 
Registered: Mar 2003
Location: a little west of Birmingham, AL, USA.
Distribution: Porteus 3.1
Posts: 934

Original Poster
Rep: Reputation: 32
...now to start transferring the system. I have no folder that you mentioned though. I have a boot.b, a rc.custom.gz, a settings.s, and a zImage. I also have a file or something named map.

Last edited by lectraplayer; 03-18-2003 at 08:44 PM.
 
Old 03-19-2003, 03:50 PM   #9
lectraplayer
Member
 
Registered: Mar 2003
Location: a little west of Birmingham, AL, USA.
Distribution: Porteus 3.1
Posts: 934

Original Poster
Rep: Reputation: 32
Anyone know how to transfer the system from floppy to hard disk?
 
Old 03-19-2003, 05:23 PM   #10
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,680

Rep: Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894
What DavidPhillips is trying to explain is how to take an existing linux system and transfer it to another drive. newdrive is a directory you create to mount your new drive.

Are you looking at the boot floppy you created during the install? The purpose is just to boot from the disk not to transfer files from.
The files you are going to transfer are all from the existing hard drive install.
 
Old 03-19-2003, 08:51 PM   #11
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
also if you boot into the floppy and mount your existing linux filesystem the mount point will need to be used instead of / in the above examples.

/ will be used if you are copying an existing, running linux filesystem
 
Old 03-19-2003, 09:24 PM   #12
lectraplayer
Member
 
Registered: Mar 2003
Location: a little west of Birmingham, AL, USA.
Distribution: Porteus 3.1
Posts: 934

Original Poster
Rep: Reputation: 32
I'm a big Linux dummie, but I didn't see any of the folders you mentioned. I was telling you what folders I had. I know this Linux I'm messin' with unpacks upon boot up, if that makes a diference.
 
Old 03-19-2003, 09:31 PM   #13
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
you must be looking at the floppy. If you boot the floppy you should have a linux system that is running in ram, this will contain the linux filesystem like I mentioned. You can't just put image files on a hard drive.

Of course I have no idea what's on the floppy(s) you are talking about, I am just guessing it's a linux system on floppy. If not you are doing something that's not possible.


Let us know what you have and what you are trying to do.
 
Old 03-30-2003, 09:39 AM   #14
lectraplayer
Member
 
Registered: Mar 2003
Location: a little west of Birmingham, AL, USA.
Distribution: Porteus 3.1
Posts: 934

Original Poster
Rep: Reputation: 32
After this Linux boots off the floppy and unpacks, I log in and go ls, and I did not see any folders you talked about. I would like to stick that Linux system on my hard disk somehow. What tool do I use? The original RPM or something?
 
Old 03-30-2003, 02:29 PM   #15
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
I'm not sure I can help, generally, but I think I see the communication breakdown. Like if it was a DOS boot floppy, you'd be running DOS in RAM and if you wanted to transfer *just* the floppy's system from the diskette to the hard drive, you'd 'sys c:' from the prompt (and maybe 'copy *.*' after that) and it would let you boot a copy of the floppy system from the hard drive. And you want to know how to do that in Linux, right? That I don't know. Do you have the boot and root images on floppy? Would swapping them in and 'dd'ing them work? Probably not, but I don't know.

Why not just install a regular system, though?
 
  


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
Format Hard Disk Don Cherry Linux - Hardware 1 02-21-2005 12:56 PM
Format hard disk! yenonn Linux - Newbie 9 10-04-2003 06:56 PM
how to format the hard drive from a console window zebra90210 Linux - Software 6 09-05-2003 04:25 AM
use linux to format a FAT32 Hard Disk ? qwijibow Linux - Newbie 4 08-29-2003 08:38 PM
hard disk format mariomason Linux - Software 1 01-08-2001 10:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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