problem installing new hard drive

G'day

I'm trying to install a new hard drive to my system but having great difficulty even to format the new hdd...

When I fdisk -l I get three of hdds:

hdg where linux lives
sda is the new 320gb hdd
sdb is 200gb ntfs and where winxp back up files are

However, I can't seem to get the new hdd to format to its full capacity as 320gb!

To get the new hdd initilialize as 320gb, I first used :
cfdisk /dev/sda

and partitioned it as single linux hdd

then
mkreiserfs /dev/sda [b]

but then mkreiserfs gave error that it's one single partition and suggested to use the [b]cfdisk -f to force the format. When I do that, then I loose the partition!!!

Can I get some assistance in getting this new hdd to work properly?
I eventually want to be able to carry my original linux hdd to this large hdd, which is the next problem/issue!!!!

cheers

Below are fdisk -l output and my /etc/fstab

>fdisk-l

Disk /dev/hdg: 80.0 GB, 80026361856 bytes
...
Device Boot Start End Blocks Id System
/dev/hdg1 1 2190 17591143+ 83 Linux
/dev/hdg2 2191 4625 19559137+ 83 Linux
/dev/hdg3 4626 9670 40523962+ 83 Linux
/dev/hdg4 9671 9729 473917+ 82 Linux swap

Disk /dev/sda: 320.0 GB, 320072933376 bytes
...
Disk /dev/sda doesn't contain a valid partition table

Disk /dev/sdb: 200.0 GB, 200049647616 bytes
...
Device Boot Start End Blocks Id System
/dev/sdb1 * 1 24320 195350368+ 7 HPFS/NTFS
/dev/sdb2 24321 24320 2147483616+ 7 HPFS/NTFS

> fstab

# /etc/fstab: static file system information.
#
#
proc /proc proc defaults 0 0
usbfs /proc/bus/usb usbfs devmode=0666 0 0
/dev/hdg1 / reiserfs defaults 0 1
/dev/hdg2 /home reiserfs
reiserfs defaults 0 2
/dev/hdg3 /data reiserfs
reiserfs defaults 0 2
/dev/hdg4 none swap sw 0 0
/dev/cdrom /media/cdrom0 udf,iso9660 user,noauto 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto 0 0

/tmp/app/1/image /tmp/app/1 cramfs,iso9660 user,noauto,ro,loop,exec 0 0
/tmp/app/2/image /tmp/app/2 cramfs,iso9660 user,noauto,ro,loop,exec 0 0
/tmp/app/3/image /tmp/app/3 cramfs,iso9660 user,noauto,ro,loop,exec 0 0
/tmp/app/4/image /tmp/app/4 cramfs,iso9660 user,noauto,ro,loop,exec 0 0
/tmp/app/5/image /tmp/app/5 cramfs,iso9660 user,noauto,ro,loop,exec 0 0
/tmp/app/6/image /tmp/app/6 cramfs,iso9660 user,noauto,ro,loop,exec 0 0
/tmp/app/7/image /tmp/app/7 cramfs,iso9660 user,noauto,ro,loop,exec 0 0

# Added by KANOTIX
/dev/sda1 /media/sda1 reiserfs noauto,users,exec 0 0
# Added by KANOTIX
/dev/sdb1 /media/sdb1 ntfs noauto,users,exec,ro,umask=000 0 0

0

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Don't know what the problem is, but...

Hi there

I don't see any reason why reiserfs could fail if the partition table is actually valid.

Creating the partition with fdisk or cfdisk should work just fine, but perhaps parted is a bit more verbose about any problems with this hd.

So, this is what you would need to do if you want to try parted out:

# parted /tmp/test print
Error: Unable to open /tmp/test - unrecognised disk label.

# parted /tmp/test mklabel msdos

# parted /tmp/test print
Disk geometry for /tmp/test: 0.000-4.000 megabytes
Disk label type: msdos
Minor Start End Type Filesystem Flags

# parted /tmp/test mkpart primary reiserfs 0 4

# parted /tmp/test print
Disk geometry for /tmp/test: 0.000-4.000 megabytes
Disk label type: msdos
Minor Start End Type Filesystem Flags
1 0.016 4.000 primary

# parted /tmp/test set 1 boot on

# parted /tmp/test print
Disk geometry for /tmp/test: 0.000-4.000 megabytes
Disk label type: msdos
Minor Start End Type Filesystem Flags
1 0.016 4.000 primary boot

In this example I created an empty file of 4MB as a "virtual hd" just to guide you through the steps. In your case of course, it will be more than 4MB and it won't be /tmp/test but /dev/sdb of course. But the real size of your hd is returned by parted when calling the "print" command (after having created the label).

parted has an interactive console mode too, so "parted /dev/sdb" is enough and it will prompt you for commands (where you can always ask for help by entering "help").

Well... don't know if this is any better than fdisk.
If it succeeded though, format it afterwards.

For the transition from your old root:

After that, all you need to do is mount both partitions (your current Linux root and you new one) from a Live CD (like Kanotix, which you seem to use) and do a

cp -a /mnt/oldroot/* /mnt/oldroot/.[a-zA-Z1-9]* /mnt/newroot/

If this is done, chroot to /mnt/newroot.
Now /mnt/newroot is /. So all commands you run/apply now are applied to /mnt/newroot as if you really booted into it.
This is the right time to adjust /etc/fstab (i.e. /dev/sdb1 is / now) and the boot loader (GRUB for example).

If you need more assistance with the last steps, just ask.

Cheers, Georg

try...

use 'cfdisk' with the '-z' option (I think it's z) - this should write zeroes into the MBR before creating the partition table. Also look at the version of utilities that you've got - maybe your mkreiserfs tool is hobbled? About 3 years ago there were also issues with the kernel itself and access to very large disks - what kernel version do you have running?

But Hello! You must tell

But Hello!

You must tell which partiton of them all. It's not easy for a application to now.

mkreiserfs /dev/sda1

well spotted

I must be going blind; I didn't see that no partition was specified. The MBR will make a very small partition - about half of a 3.5" floppy...

problems rose, ensued and overcome!

yeap, not having used the partition number was the problem.
cfdisk then mkreiserfs for both sda1 and sdb1 worked like they should.

How do I go about moving my Linux installation from one hdd to another?

As I understand it, first using a liveCD like "kanotix" booting then:
* first create the same directory structure on the target hdd
* second copy using something like cp -pR to copy directories over

next step is modifying Grub, which is where I'm bit lost...
any help with this?

cheers

you can boot normally

Then partition/format you other disk, and transfer your system using 'cp' and the 'archive' mode (so that symlinks also appear as symlinks). Choose which directories to copy - you don't want to copy ones like dev, dev/pts, sys, proc because these are all virtual directories. You still need to create those directories on your other disk though.

After copying everything, use 'mount' to bind the existing virtual directories to your new HD, then use "chroot" to switch your new HD into the root filesystem. Now you can install 'grub' on this new HD. If you are going to put that HD in a new computer, or swap it with your current HD, then you need to check boot options in /boot/grub/menu.lst - but if you get it wrong it's not really a problem as long as you know how to work with grub's command line at boot time.

Syndicate content