Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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!
Distribution: Slackware 11, Solaris 10, Solaris 9, Sourcemage 0.9.6
Posts: 322
Rep:
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.
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
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).
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
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.