LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   format a partion (https://www.linuxquestions.org/questions/linux-software-2/format-a-partion-456757/)

hammam12 06-20-2006 08:22 PM

format a partion
 
hi all,
Could someone tell me how to format a partition in the hard disk using console in linux opensuse 10.1 or any utility.
my machine has two dual system 1- wnixp 2-linux opensuse 10.1
I got run of space in linux, I have a partion e:/windows does not used, I want to move /usr to it ?
Could someone tell me how ? give example pls.
... thanx
Mohammed Hammam

cereal83 06-20-2006 08:27 PM

to format:

ext2 - mke2fs /dev/hda1
ext3 - mke2fs /dev/hda1 ; tune2fs -j /dev/hda1
ReiserFS - mkreiserfs /dev/hda1


This is assuming you are formating the first partion on the first drive. If it is the first partition on the 2nd drive then /dev/hda1 would become /dev/hdb1. If it is SATA drive on the 2nd partition then it would be /dev/sda2

After you format, you would edit /etc/fstab and add in that parition so when you boot it automatically loads that partition!

Hope you understand

hammam12 06-20-2006 08:37 PM

I ran
linux-9tgg:/bin # mke2fs /dev/hdc7
mke2fs 1.38 (30-Jun-2005)
/dev/hdc7 is mounted; will not make a filesystem here!

my partition is hdc7

Could you pls tell what error I did in that command ?

cereal83 06-20-2006 08:40 PM

you will have to umount the partition before you format so

umount /dev/hdc7
mke2fs /dev/hdc7

then mount it where you want so like,

mount /dev/hdc7 /mp3s

If you need more help, ask.

Thanks

cereal83 06-20-2006 08:42 PM

Just make sure the partition you want to format is for sure /dev/hdc7

hammam12 06-20-2006 09:09 PM

umount /dev/hdc7
linux-9tgg:/bin # mke2fs /dev/hdc7
linux-9tgg:/bin # tune2fs -j /dev/hdc7

the above successfully run

now what do you mean by ..
'then mount it where you want so like'
my problem is I got ran of space in / 98% , I want to move /usr to that partition(hdc7) to free space

cereal83 06-20-2006 09:18 PM

ok well first I am glad that the above commands worked.

To use the partition, you first have to mount it. I am not sure if I am 100% correct on this but to move everything from /usr to /dev/hdc7 then you would have to

mount /dev/hdc7 /mnt - This will mount it to /mnt while we copy the files over
cp -advf /usr/ /mnt - This will copy all the files to /mnt where /dev/hdc7 is mounted
pico or vi /etc/fstab - You will have to edit /etc/fstab and put that you want to mount /dev/hdc7 to /usr
/dev/hdc7 /usr ext3 defaults 1 1 - put this line in the /etc/fstab
reboot the computer


Again, I have never done this so I am not 100% sure that this is the way to do it but I would think it is. The only thing I have no clue on would be how to delete the old /usr so you have more space.

Maybe somebody else knows 100% if this is the correct way

hammam12 06-20-2006 10:32 PM

cp -advf /usr/ /mnt
successfully done
I add the line in fstab but I could not save it. Could you pls tell me how to save it ?

cereal83 06-20-2006 10:34 PM

make sure you are root when you edit /etc/fstab After that, you should be able to save it

also if you do the "df" command you should see /dev/hdc7 /mnt and if you do

"du -ch /usr"
"du -ch /mnt"

They should be the same size

hammam12 06-20-2006 10:40 PM

I am login as user. how I be a root, you mean login again as root and then add that line infstab. by the way I edit fstab by kate is it ok ?

cereal83 06-20-2006 10:46 PM

you can just type "su" then it will ask for a password and you will now be a Super User which is root, to exit out of root, you just type exit and you will be back again at a normal user.

Any program to edit files is fine. I used pico and vi so thats why I mentioned it up there.

hammam12 06-20-2006 11:04 PM

pico or vi they are only view mode.
in run mode i type su and entered the password. but it can not save, it should something I do it wrong, pls try to help.
I reboot the machine and now I could save the fstab.
The problem now it goes now to cli mode could you help to let it goes to gui mode directly. By the way I used startx but noway.

cereal83 06-21-2006 10:59 PM

Hey, just checking up to see how you are doing. Let me know

hammam12 06-22-2006 01:16 AM

thank you. I was so tired yesterday.
Now the status :
os = linux opensuse 10.1
my machine has dual system winxp - suse
problem = lake of spaces in / linux 99% used
resolution I did = format /windows/F to be used in linux
/dev/hdc7
problem now :
when my machine started and I go to suse, it goes to cli mode not desktop gui mode.
when I login either in root or user, it says these two message
/sbin/yast: line 18:/usr/lib/yast2/bin/yast2-funcs : no such file or directory
/sbin/yast: line 66: /usr/bin/getopt: no such file or directory
even if I type
startx
it says :
no startx installed
before login I noticed this message :
/etc/init.d/dhcpd: "/usr/sbin/dhcpd" is not an executable file. exiting. ===========> failed
Could you pls tell me how I correct this situation.
... thanx
Mohammed Hammam

hammam12 06-26-2006 07:22 AM

thank you all
the issue has been resolved
... thanx
Mohammed Hammam


All times are GMT -5. The time now is 05:51 AM.