LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-20-2006, 08:22 PM   #1
hammam12
Member
 
Registered: Jun 2006
Posts: 160

Rep: Reputation: 30
Cool 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
 
Old 06-20-2006, 08:27 PM   #2
cereal83
Member
 
Registered: Feb 2004
Location: Canada
Distribution: Slackware
Posts: 479

Rep: Reputation: 30
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
 
Old 06-20-2006, 08:37 PM   #3
hammam12
Member
 
Registered: Jun 2006
Posts: 160

Original Poster
Rep: Reputation: 30
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 ?
 
Old 06-20-2006, 08:40 PM   #4
cereal83
Member
 
Registered: Feb 2004
Location: Canada
Distribution: Slackware
Posts: 479

Rep: Reputation: 30
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
 
Old 06-20-2006, 08:42 PM   #5
cereal83
Member
 
Registered: Feb 2004
Location: Canada
Distribution: Slackware
Posts: 479

Rep: Reputation: 30
Just make sure the partition you want to format is for sure /dev/hdc7
 
Old 06-20-2006, 09:09 PM   #6
hammam12
Member
 
Registered: Jun 2006
Posts: 160

Original Poster
Rep: Reputation: 30
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
 
Old 06-20-2006, 09:18 PM   #7
cereal83
Member
 
Registered: Feb 2004
Location: Canada
Distribution: Slackware
Posts: 479

Rep: Reputation: 30
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
 
Old 06-20-2006, 10:32 PM   #8
hammam12
Member
 
Registered: Jun 2006
Posts: 160

Original Poster
Rep: Reputation: 30
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 ?
 
Old 06-20-2006, 10:34 PM   #9
cereal83
Member
 
Registered: Feb 2004
Location: Canada
Distribution: Slackware
Posts: 479

Rep: Reputation: 30
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
 
Old 06-20-2006, 10:40 PM   #10
hammam12
Member
 
Registered: Jun 2006
Posts: 160

Original Poster
Rep: Reputation: 30
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 ?

Last edited by hammam12; 06-20-2006 at 10:42 PM.
 
Old 06-20-2006, 10:46 PM   #11
cereal83
Member
 
Registered: Feb 2004
Location: Canada
Distribution: Slackware
Posts: 479

Rep: Reputation: 30
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.
 
Old 06-20-2006, 11:04 PM   #12
hammam12
Member
 
Registered: Jun 2006
Posts: 160

Original Poster
Rep: Reputation: 30
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.

Last edited by hammam12; 06-21-2006 at 12:24 AM.
 
Old 06-21-2006, 10:59 PM   #13
cereal83
Member
 
Registered: Feb 2004
Location: Canada
Distribution: Slackware
Posts: 479

Rep: Reputation: 30
Hey, just checking up to see how you are doing. Let me know
 
Old 06-22-2006, 01:16 AM   #14
hammam12
Member
 
Registered: Jun 2006
Posts: 160

Original Poster
Rep: Reputation: 30
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
 
Old 06-26-2006, 07:22 AM   #15
hammam12
Member
 
Registered: Jun 2006
Posts: 160

Original Poster
Rep: Reputation: 30
thank you all
the issue has been resolved
... thanx
Mohammed Hammam
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
format a hard drive (/dev/hda1) in Reiser fs format Linh Linux - General 7 06-17-2009 06:30 AM
Problems booting up linux suse 9.1 personal can't partion and format HD? boater0_14 Linux - Software 0 09-14-2004 01:31 PM
how do i move files from my windows partion to my linux partion awesome_man Linux - Newbie 2 01-30-2004 12:51 PM
Must "/boot" partion be installed in the primary partion? domeili Linux - Newbie 9 11-01-2003 08:27 AM
Format Problems Saving Star Office Docs in Word Format kkempter Linux - Software 4 08-27-2003 04:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:05 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration