Click to See Complete Forum and Search --> : Mount External USB Drive w/ Existing Partitions


GnomeProject
07-08-2003, 04:40 PM
For those of you that are thinking there are numerous posts on this subject and that I haven't read them all, well I have and this is indeed a novel question, so there, ;-p.

Alright, now for my question. Well I have a brand new external USB hard drive that now holds my old laptop hard drive with existing Linux partitions (ie. / , /boot, and swap). Now, my question is, how can I delete that swap space and the boot sector and create a new partition with that area of the drive and conserve the existing / directory??? Then, I want to take these partions and automount them when my laptop starts up??? Any suggestions? I probably have to make some sort of symlink or alias to the / partition since I already have one on my current laptop hard drive, don't I? Thanks for all your suggestions. Below you will find my current drive configuration and fstab file:

FSTAB:

LABEL=/ / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
none /dev/pts devpts gid=5,mode=620 0 0
LABEL=/home /home ext3 defaults 1 2
none /proc proc defaults 0 0
none /dev/shm tmpfs defaults 0 0
LABEL=/usr /usr ext3 defaults 1 2
LABEL=/var /var ext3 defaults 1 2
/dev/hda6 swap swap defaults 0 0
/dev/sda /mnt/usbdrive ext3 user,auto,rw 0 0
/dev/cdrom /mnt/cdrom udf,iso9660 noauto,owner,kudzu,ro 0 0
/dev/fd0 /mnt/floppy auto noauto,owner,kudzu 0 0


and now for the hard drives:

/dev/hda
/dev/hda1 /boot (1)
/dev/hda2 / (1)
/dev/hda3 /var
/dev/hda4
/dev/hda5 /usr
/dev/hda6 swap (1)
/dev/hda7 /home

/dev/sda
/dev/sda1 /boot (2)
/dev/sda2 / (2)
/dev/sda3 swap (2)


Thanks all!!!

-Adam


BTW: This is my 100th post!!!!!

mdwatts
07-08-2003, 04:50 PM
Use fdisk and delete /dev/sda3 and then recreate using fdisk and format with mkfs.ext2 -j /dev/sda3 (for ext3)?

GnomeProject
07-08-2003, 05:06 PM
1) Use fdisk to delete both swap and /boot by issueing the following from a command prompt????

fdisk /dev/sda3

fdisk /dev/sda1

2)Then create them again...

mkfs.ext3 -j /dev/sda3

mkfs.ext3 -j /dev/sda1

Is that correct, or do I do something else? Can I run fdisk from a command prompt inside my current workspace without worry? Can I rename those partitions something else during that process, if so when? Thanks.

-Adam

mdwatts
07-08-2003, 05:08 PM
The /boot you can probably just reformat with mkfs... , but the swap partition will need to be deleted with fdisk and then a partition recreated in it's place again using fdisk and then format with mkfs ...

And yes you should be able to do all this within your workspace at the commandline.

GnomeProject
07-08-2003, 05:11 PM
First let me say thanks for quick response...


But, is there an easy way just to delete the partitions while I am logged in under Gnome then just merge them with the / partition??? Thanks.

mdwatts
07-08-2003, 05:20 PM
Use GNU Parted (http://www.gnu.org/software/parted/) (it may already be installed) to delete those partitions and then to resize '/'.

Or copy the contents of /dev/sda2 to your HD, delete all, recreate, format and then copy everything back.

Up to you though.