Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Linux Partitions Mounting and Combining? [OK]

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
nayoo
Posts: 316
Joined: 2006-03-28 01:51

Linux Partitions Mounting and Combining? [OK]

#1 Post by nayoo »

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: 316
Joined: 2006-03-28 01:51

#2 Post by nayoo »

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: 316
Joined: 2006-03-28 01:51

#3 Post by nayoo »

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?

Grifter
Posts: 1554
Joined: 2006-05-04 07:53
Location: Svea Rike

#4 Post by Grifter »

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...

nayoo
Posts: 316
Joined: 2006-03-28 01:51

#5 Post by nayoo »

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.

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

#6 Post by Lavene »

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

nayoo
Posts: 316
Joined: 2006-03-28 01:51

#7 Post by nayoo »

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.

ajdlinux
Posts: 2452
Joined: 2006-04-23 09:37
Location: Port Macquarie, NSW, Australia

#8 Post by ajdlinux »

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.

nayoo
Posts: 316
Joined: 2006-03-28 01:51

#9 Post by nayoo »

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

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

#10 Post by Lavene »

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 ;)

nayoo
Posts: 316
Joined: 2006-03-28 01:51

#11 Post by nayoo »

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.

Post Reply