LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Partition help (https://www.linuxquestions.org/questions/linux-newbie-8/partition-help-362629/)

Itachi 09-12-2005 08:15 AM

Partition help
 
hi,
i have a partition for windows and another for linux
windows : hda1
i want to change hda1 into a ext2 filesystem.
can anyone give me a step by step guidance on how to use sfdisk?
i searched on the net and found this site http://www.die.net/doc/linux/man/man8/sfdisk.8.html
and follow its instruction to save in case i do something stupid
so i did this
sfdisk /dev/hdd -O hdd-partition-sectors.save

and got this msg

Checking that no-one is using this disk right now ...
BLKRRPART: Invalid argument

This disk is currently in use - repartitioning is probably a bad idea.
Umount all file systems, and swapoff all swap partitions on this disk.
Use the --no-reread flag to suppress this check.
Use the --force flag to overrule all checks.


so i am not very confident about carrying out this partition for i do not want to delete my other partition wrongly. someone pls help me.thks in advance!

dinolinux 09-12-2005 08:52 AM

First of all, are you root? If not, log in as root and:
Code:

umount /dev/hda1
Then pick a partitioning tool. I don't know anything about sfdisk, but it doesn't seem newbie friendly. Try cfdisk instead. It has a nice interface and it's easy to navigate.

Wally68 09-12-2005 08:57 AM

Do you want to get rid of windows? I ask this because as far as I know windows thinks it has to be the in the first partition of the first hard disc (/dev/hda1).

Quote:

sfdisk /dev/hdd -O hdd-partition-sectors.save
/dev/hdd is usually your second cd drive, and can not be partitioned

I'm not sure about sfdisk as I don't use it try

Code:

man sfdisk

WhatsHisName 09-13-2005 12:04 AM

Itachi: If you want to destroy your windows installation in hda1 and to reformat hda1 as ext2, then all you need to do is to unmount the partition and with root user privileges run:

mke2fs /dev/hda1

You probably really want an ext3, which would be:

mke2fs -j /dev/hda1

Then, fire up linux fdisk and change the hda1 partition type using fdisk command “t” to “linux” (type 83).

For more info about mke2fs, run:

man mke2fs

Itachi 09-13-2005 02:02 AM

Hi whathisname,
I followed ur instructions. not sure if i understood correctly but this is what i got.
can give me some more tips? pls..thks


[root@localhost Programs]# /sbin/fdisk -t /dev/hda1 83
/sbin/fdisk: invalid option -- t

Usage: fdisk [-b SSZ] [-u] DISK Change partition table
fdisk -l [-b SSZ] [-u] DISK List partition table(s)
fdisk -s PARTITION Give partition size(s) in blocks
fdisk -v Give fdisk version
Here DISK is something like /dev/hdb or /dev/sda
and PARTITION is something like /dev/hda7
-u: give Start and End in sector (instead of cylinder) units
-b 2048: (for certain MO disks) use 2048-byte sectors

mattyoly 09-13-2005 02:26 AM

As whatshisname said, you should've looked a little bit more into it, with the man mke2fs, or man :mke2fs, which you type in your address bar, or your terminal windows just in case you never used man before. And you can do the same for fdisk with man:fdisk . You use fdisk to format you partition, and then you use mke2fs to convert it to ext3 .
There is also cfdisk, what i use. (man:cfdisk)
If you just get into you terminalwindow and type cfdisk, your partitions will show up in the window, and you will have a choice to delete/convert into free space, you will see what i mean, that's if you have cfdisk, if you don't try to get it. It's not bad.
Good luck with it, oh and by the way, if you formad your hda1 partition, on your hard drive, which according to you holds windows, you will not be able to start windows anymore, and you will lose all the files that you have on the windows side. Just a heads up.

WhatsHisName 09-13-2005 09:07 AM

Itachi: Start fdisk in the terminal like this:

fdisk /dev/hda

and then use the fdisk shell commands to change the partition type.

Be sure to write (“w”) the final setup to the disk. The changes only take effect if you write them to the disk.


All times are GMT -5. The time now is 12:14 AM.