Formatting HD after penboot


Forum: USB booting
Topic: Formatting HD after penboot
started by: JohnH

Posted by JohnH on Mar. 19 2006,14:05
I am trying to partition, format and use a hard drive on my pen drive booted system.

A search of "format AND hard drive" or "format AND hd" yeilds no results.

How should I proceed?

Posted by ~thc on Mar. 19 2006,15:26
first you must know which device actually is your (first/only) harddisk.

most computers today should contain a parallel ata or 'compatible mode' serial ata harddisk - this will be accessible as '/dev/hda'. scsi harddisks or sata/ahci mode serial ata harddisks sould be accessible as '/dev/sda'. your pen drive will be accessible under '/dev/sda' in the former or '/dev/sdb' in the latter case.

second you need to know that the normal 'formatting' of a harddisk under windows means 'making a file system' under linux. i.e. if you decide to create a new 'ext3' filesystem on your first p-ata harddisk enter

'mkfs.ext3 /dev/hda'

in a root shell. 'ext2' and 'minix' filesystems are natively supported by dsl too. others may be available through dsl extensions.

Posted by JohnH on Mar. 19 2006,19:50
The drive I'm using is from another computer that has linux installed. It shows up as hda in Emelfm it has /hda1 and /hda3. I think the invisible swap partition is hda2.

What I would like to do is:

1. run the equivalent of dos fdisk command to re-partition the drive.

2. format the drive

or

just empty and reformat the existing partitions.

Posted by ~thc on Mar. 20 2006,07:41
1. open a root shell
2. use 'fdisk /dev/hda' (text) or 'cfdisk /dev/hda' (menu) to repartition the drive and create one or more new partitions
3. make the desired filesystems i.e. 'mkfs.ext2 /dev/hda1' or 'mkswap /dev/hda3' or 'mkfs.ext3 /dev/hda5'

Posted by JohnH on Mar. 22 2006,11:41
Thanks ~thc
That's what I was looking for

Posted by JohnH on Mar. 22 2006,13:28
OK I had a 4gig ide hd with hda1 100mb bootable, 1gig swap, and hda3 3gig

I booted on my pen drive and opened ATerminal as root
after cfdisk deleting all partitions and making one 4gig ext3 bootable partition (mkfs.ext /dev/hda1)
The hda1 appears in the file system and in the mount tool. I clicked so there was a green "mounted" button in the file tool.

Then trying to download linux documentation and selecting the /mnt/hda1 partition to download to I get "cannot create file directory /mnt/hda1 is not writable"

Posted by doobit on Mar. 22 2006,13:45
you need the -j switch (journaling) to make it ext3. Like mke2fs -J /dev/hda1 , or using the script mkfs.ext3 /dev/hda1 I don't know if the script is included in DSL though so I have always used the first option. Here is a manpage on the subject:

< http://www.netadmintools.com/html/8mke2fs.man.html >

Posted by JohnH on Mar. 22 2006,13:52
Quote (doobit @ Mar. 22 2006,08:45)
you need the -j switch (journaling) to make it ext3. Like mke2fs -J /dev/hda1 , or using the script mkfs.ext3 /dev/hda1 I don't know if the script is included in DSL though so I have always used the first option. Here is a manpage on the subject:

< http://www.netadmintools.com/html/8mke2fs.man.html >

I used mkfs.ext3 /dev/hda1

The process went on without any warnings or errors.

Posted by anaconda on Mar. 22 2006,14:10
Did you do the saving as "root" or as a regular user. Sometimes regular users don't have the writing permission for mounted drives. (writing permission is given in /etc/fstab file..)

And I think 1GB swap partition is quite big for a 4GB hard disk!!
Maybe it would be a good idea to NOT have a swap partition at all in such a small disk!!! I would make the linux partition 1GB bigger and use a swap file, which size would be easy to change if you need more space...

And IGB for swap is too much anyway. I have 512MB of ram and usuallu I have 256MB for swap which has always been enough.

The old "rule" to make swap 2x actual RAM is to much when you have 512MB of ram And if you have 1024MB of RAM you dont need swap at all!

Posted by JohnH on Mar. 22 2006,14:43
I just tried a "workaround". From Firefox I downloaded to /tmp then opened Emelfm as superuser and copied from /tmp to /mnt/hda1. That seems to have worked but that sucks to have to make such a twity set of steps...

BTW i opened a terminal and typed sudo su

Posted by ~thc on Mar. 22 2006,16:18
in any filesystem created under somewhat normal un*x conditions the access rights for the root directory itself ("/.") are "rwxr-xr-x root root".

if you want to use the root directory itself for "normal user" storage (as you tried to), open a root shell and type

chmod 777 /mnt/hda1

while the disk is already mounted.

Posted by JohnH on Mar. 23 2006,01:52
So even though this system is booting from a pen drive, the root of the filesystem is still hda1?
Posted by anaconda on Mar. 23 2006,06:55
Quote
So even though this system is booting from a pen drive, the root of the filesystem is still hda1?


No! He just meant the root directory of hda1, which is in /mnt/hda1.

Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.