Linux Partitions Mounting and Combining? [OK]

If none of the more specific forums is the right place to ask

Linux Partitions Mounting and Combining? [OK]

Postby nayoo » 2006-06-04 05:14

Hi All,

My HDD is partitioned as followed:
Code: Select all
Disk /dev/hda: 40.0 GB, 40007761920 bytes
255 heads, 63 sectors/track, 4864 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1        3166    25430863+   c  W95 FAT32 (LBA)
/dev/hda2            3825        4817     7976272+  83  Linux
/dev/hda3            4818        4864      377527+   5  Extended
/dev/hda4            3167        3824     5285385   83  Linux
/dev/hda5            4818        4864      377496   82  Linux swap / Solaris

Partition table entries are not in disk order


and my fstab is
Code: Select all
# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    defaults        0       0
/dev/hda2       /               ext3    defaults,errors=remount-ro 0       1
/dev/hda5       none            swap    sw              0       0
/dev/hdc        /media/cdrom0   iso9660 ro,user,noauto  0       0


I have two questions:

Q1. How can I edit "fstab" file in order for the sytem to mount "hda4" automatically at boot?
Q2. Can I combine "hda2" and "hda4" into a single partition? (See above)

FYI: I got "hda4" by using "gparted" to get some spaces from "Win XP" patition, "hda1".

Thanks in advance,
N.O
Last edited by nayoo on 2006-06-04 08:03, edited 1 time in total.
nayoo
 
Posts: 320
Joined: 2006-03-28 01:51

Postby nayoo » 2006-06-04 06:36

Q1 : Solved.

I modified the fstab as followed and restarted the computer. It works.

Code: Select all
# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
/proc            /proc           proc    defaults        0       0
/dev/hda2       /               ext3    defaults,errors=remount-ro 0       1
/dev/hda4       /mnt/hdd2       ext3    defaults        0       0
/dev/hda5       none            swap    sw              0       0
/dev/hdc        /media/cdrom0   iso9660 ro,user,noauto  0       0


It was also known that after modification of fstab, the following command can be used without rebooting. In my case, I rebooted the system.
Code: Select all
# /bin/mount -a


Q2 : Possible to combine two partitions "hda2" and "hda4" into single partition? Now I am running Linux in "hda2".
nayoo
 
Posts: 320
Joined: 2006-03-28 01:51

Postby nayoo » 2006-06-04 06:55

Q1 Solution Additional Info

Mounting Win XP patition under Linux : Solved.

I modified my fstab as followed again and did "mount -a" and it works. I posted here as my contribution to this forum.

My modified fstab:
Code: Select all
# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
/proc            /proc           proc    defaults        0       0
/dev/hda1       /mnt/windows    vfat    defaults        0       0
/dev/hda2       /               ext3    defaults,errors=remount-ro 0       1
/dev/hda4       /mnt/hdd2       ext3    defaults        0       0
/dev/hda5       none            swap    sw              0       0
/dev/hdc        /media/cdrom0   iso9660 ro,user,noauto  0       0


Q2 still left unsolved. Any idea?
nayoo
 
Posts: 320
Joined: 2006-03-28 01:51

Postby Grifter » 2006-06-04 07:40

it should be possible, you just have to be careful about the values and numbers, and i think you'll have to do it from a cd or rescue disk with ext3, with reiser i know you can grow the filesystem on the fly
Eagles may soar, but weasels don't get sucked into jet engines...
Grifter
 
Posts: 1572
Joined: 2006-05-04 07:53
Location: Svea Rike

Postby nayoo » 2006-06-04 08:02

Thanks, Grifter.

I think I understand what you said. Last time I could not merge (or combine) two Linux partitions using "gparted" because I didn't do it from a disc. Now I realized (from your post) that I need a rescue disc to do it, and it is doable.

Since it is not very urgent to do it (combining two partitions), I'll leave it as it is now and may be I will do it one day.

Again, thanks for your suggestion and this matter is closed.
nayoo
 
Posts: 320
Joined: 2006-03-28 01:51

Postby Lavene » 2006-06-04 11:29

KNOPPIX is a very handy LiveCD. Lots of nice tools for just that kind of things... and more :)

Highly recomended when you need to boot of something else than your HD.

Tina
Lavene
Site admin
 
Posts: 5096
Joined: 2006-01-04 04:26
Location: Oslo, Norway

Postby nayoo » 2006-06-04 11:34

Lavene wrote:KNOPPIX is a very handy LiveCD. Lots of nice tools for just that kind of things... and more :)

Highly recomended when you need to boot of something else than your HD.

Tina


Thanks, Tina.

I'll explore more about it.
nayoo
 
Posts: 320
Joined: 2006-03-28 01:51

Postby ajdlinux » 2006-06-04 20:51

To merge your two partitions one way would simply be to copy the files from hda2/4 to the other one, then use a partitioner to delete one of them and resize the new one.
ajdlinux
 
Posts: 2480
Joined: 2006-04-23 09:37
Location: Port Macquarie, NSW, Australia

Postby nayoo » 2006-06-05 01:07

ajdlinux wrote:To merge your two partitions one way would simply be to copy the files from hda2/4 to the other one, then use a partitioner to delete one of them and resize the new one.

hda2 is my current Linux OS partition. hda4 was the result of resizing partition from hda1, Windows partition using gparted.

I tried to merge hda2 and hda4 using "gparted" from Linux. (i.e not from Disc). It was not successful. I tried it in last month. I did not try it yesterday.

So for the moment, hda4 is empty and is it possible to merge hda2 and hda4 using "gparted" from Linux(which is in hda2)? Or must I use "gparted" CD disc or Knopix live cd to merge?

FYI:
hda1 = windows partition
hda2 = my current Linux partition
hda4 = empty Linux partition
nayoo
 
Posts: 320
Joined: 2006-03-28 01:51

Postby Lavene » 2006-06-05 03:26

You need to boot of something else because the partitions you want to edit can not be mounted.

So booting from, say Knoppix, you can use a partition editor and do as ajdlinux sugested; delete hda4 and expand hda2.

Tina

PS: Don't forget to back up important stuff before you start ;)
Lavene
Site admin
 
Posts: 5096
Joined: 2006-01-04 04:26
Location: Oslo, Norway

Postby nayoo » 2006-06-05 03:42

Thanks Tina and ajdlinux,

Now I know that I "must" use LiveCD (Knopix/gparted) to do this (merging hda2 and hda4) and I could not do it from Linux since hda2 is in use.

I'm thinking of leaving it as it is now because I still could use 50% of space of my hda2 and I could mount hda4 from fstab and could access and save my data there in future.

Anyway, thanks a lot for your clear explanations and suggestions.
nayoo
 
Posts: 320
Joined: 2006-03-28 01:51


Return to General Questions

Who is online

Users browsing this forum: No registered users and 8 guests

fashionable