Delete Windows 7 and reuse space as storage

Hello,

I installed openSUSE leap 42.2 next to my new installed Windows 7. During the update process of Windows the system crashed, where-after I got the message that my Windows is broken and I need to repair it using an installation disk. I decided that I won’t use Windows anymore and deleted the partitions holding Windows. My harddisk has now the following structure:

/dev/sda
/dev/sda3 extended
/dev/sda5 Linux swap
/dev/sda6

Today I tried to somehow allocate the extended /dev/sda3 partition to my Linux system to use it as storage. Unfortunately, when trying to format it I get the error “extended partition cannot be edited”. Further when trying to delete it I get an error message telling me that sda5 and sda6 are currently mounted to sda3 and therefore I should not delete it unless I’m sure what I’m doing. So here I am. What is the best thing to do? Is it even possible to reuse the free space?

PS: I deleted the partition with windows yesterday and today I still saw the option to boot to windows. This message now disappeared. Is it possible to change the settings such that I automatically boot to openSUSE?

Best regards

Extended partitions are just containers in your case it has 2 logical partitions in it sd5 and sd6. It may or may not be full. Best to show us

sudo fdisk -l

Please use code tags to stop the editor fro reformatting computer output. # in tool bar

In Yast -bootloader section make a small change then back to trick it into thinking there is a change then accept this will reinstall grub

First try to understand what an extended partition is: https://en.opensuse.org/SDB%3ABasics_of_partitions,_filesystems,_mount_points
You will that se where sda5 and sda6 are and why tioy can nit meddle around with ext3.

And to give us a real idea about your partitioning let the computer talk:

su -l -c 'fdisk -l'

Please use CODE tags around copied/pasted computer text in a post. It is the # button in the tool bar of the post editor. When applicable copy/paste complete, that is including the prompt, the command, the output and the next prompt.

Here we go with the fdisk -l output:



Disk /dev/sda: 238.5 GiB, 256060514304 bytes, 500118192 sectors
  Units: sectors of 1 * 512 = 512 bytes
  Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
  Disklabel type: dos
  Disk identifier: 0xfe14e83c

  Device     Boot     Start       End   Sectors  Size Id Type
  /dev/sda3  *    273547264 500118191 226570928  108G  5 Extended
  /dev/sda5       273549312 277747711   4198400    2G 82 Linux swap / Solaris
  /dev/sda6       277749760 500117503 222367744  106G 83 Linux

Excuse me for not using the code environment in the first post

I assume you installed without a separate home partition. since it does not seem to be there.Also assume Windows was installed in sda which you seem to hae nuked. So you have now 130 gig free at the front of the disk where you could create a partition and perhaps use it as home. You currently have a /home directory in the root partition /.

You could move this to a new partition at sda. It is not really hard but you must plan the more carefully. Create the partition and format as xfs or ext4 your choice. Mount it at a temp location for the moment. copy the contents of /home to the new partition. Just the contents not /home itself. Go into Yast partition management and mount the new as /home. This does not erase the old home just overrides it. If you want to get rid of it boot to run level 1 (this does not by default mount the home partition). Rename or move /home to a new location. Think it through, take your time and double check all things before committing.

If that is not what you want please advise and ask if you have doubts or problems don’t guess.

My advice is very similar to gogalthorpe’s.

First you should make up your mind where you want to use that space for. Indeed most probably for your /home. But it could be for something different like all your music when you are a music collector, or a database, or whatever.

Then, you should first make a good and even more detailed plan then the outline gogalthorpe painted for you. You should thoroughly understand what you are going to do. Maybe post it here first for comment. Specially the creation of the partition in the gap (that will be sda1) must be done correct, or you will overwite something in sda3 en thus sda5 that will destroy all there! I do not know if e.g. YaST > System > Partitioning will help you in detecting what the upper boundary of a new sda1 can be (I always avoided not working at the end of already partitioned space in about 40 years now).

In any case, make an extra backup of /home when the normal users are not loged in as the last thing before you start to reorganise!!!
And be prepared for breaking your system, thus backup other thing like /etc and lists of added software. etc. In short, all you need to reinstall nd bring the system to the same level ass it is now.

You are totally right, this is the current status and my plan is to reuse the nuked area. Since I also have 100gb in my current drive I would rather leave the /home as it is and simply make the space acessible. I’m having something in mind as it was before with windows installed: Access,edit the data as it were on an external usb drive.

Here we go with the plan I try to submitt: I go to YaST - partitioner, select /dev/sda/ with right click and press add partition - New Partition Type: Primary Partition - New Partition size: Maximum Size (130.43 gb) - Role: Data and ISV Application - Formatting Options: ext4 (as I did for the linux operating partition - is there any pro/cons to change this?) / Mounting Options: Mount partition - Mount Point: /home

Is this a good idea or am I missing something important? Respectively, will this take all free space available and make it accessable in my /home directory?

Thank you very much for your help!

No. you replace current /home with new /home. The new /home would mask the old home and make it unaccessible chose a different mount point if you want it in your /home directory then maybe mount at /home/data or /home/youruser/data or some such name or mount point just not /home or other

Exactly. First you say you do NOT want it to be /home and then you say you want. That is very contradictory.

BTW, we assume that you are confident with: SDB:Basics of partitions, filesystems, mount points - openSUSE Wiki
else discussions will become difficult.

The problem just completely changed its face. I logged out yesterday, closed the notebook and left the computer running over night. When trying to start it this morning, I realized that the computer ran out of battery. After plugging in the charger I tried to boot my system. This does not work anymore. I already tried to boot in secure mode and using the “Boot existing Linux system” option on my usb-stick with SystemRecoveryCd installed.

UPDATE: I just realize that the point it stops booting is simply the command line. I’m able to log in and access my files from there, but the desktop (i got xcfe installed) does not start.

Any ideas how to get it back running?

PS: the first time i tried to boot in secure mode it worked, trying to reboot and start the system in normal mode than did not work and trying the secure mode again did not work on the second attempt.

Well, “it did not work” does not provide much information.

Any messages? Did you hit the Esc key to see what happens?

Log in as root type init 5 report any errors. This should start the GUI

This works, thank you so much. I now restarted the System and it again boots to the GUI. Could this problem be caused by the fact that I logged out and the computer died due to empty battery? Thus, should I take care to properly shut down the computer every time it could run out of battery?

Returning to the previous question: I read the linked article and believe I now understand what mounting means. My idea would be to create a new folder /home2 and simply mount it there. As I understand this will than permanently make the 130 gb accessible via /home2…?

Thus I would submit this: YaST - partitioner, select /dev/sda/ with right click and press add partition - New Partition Type: Primary Partition - New Partition size: Maximum Size (130.43 gb) - Role: Data and ISV Application - Formatting Options: ext4 (as I did for the linux operating partition - is there any pro/cons to change this?) / Mounting Options: Mount partition / Mount Point: /home2

While I assume that in theory hard and software must be able to cope with a power failure, I personaly would not leave a computer on when it is more then likely to happen when I can avoid it.

OK, it is fine you have a better idea about mounting now. That makes the talking easier.
You will now have understood that choosing a mount point is up to you. Thus my following remarks are only my peronal thoughts.
The name /home2 gives me the idea that it is something similar to /home: a place to have the home directories of users. I do not think that that is what you want it to use for. You do nothave that many users that you want them to be in different /homeN directories on different file systems.

I assume the main decission is if this is for some system data, or if it is for data for a user (like his music, or …) When it is for system purposes (a central data base, or web server, …)I would either mount it direct under / al e.g. /database or (for a web server) in the prepared place for it /srv or /srv/www/htdocs.

When it is provide a user (lets us name him john) with extra space, I would probably mount it somewhere in his home directory because he then can access that like his other data. Example: /home/john/Music.
In this case, do not forget that you must (as root) change the ownership of the mount point to that user john.

An often used alternative way is mounting at /mnt/music-of-john (again, make john the owner) and then create a symbolic link from /home/john/Music to the mountpoint. The result will be the same as above.

That looks feasable. Do not forget if the place and size of the new partition are correctly determined by YaST. As this is not at the end of the existing partitions, I am not 1000% sure that YaST will see this correct.
I am not sure what that Role: thing does. I do not see it in my 13.2 YaST. But I guess it is only some text that goes maybe somewhere?

YaST will do the folowing for you

  • edit the partition table on the disk to include data about the new sda1;
  • create an ext4 file system on that new partitionj;
  • create the mount point if it does not already exist;
  • mount;
  • create an entry in /etc/fstab so that mounting will also take place at every boot.

It is up to you to change the ownership of the mount point if that is needed.

It perfectly worked. Thank you so much!

Hurray! Congratulations. It is always feeling tricky when you do such a thing for the first time. But one learns much from it.

We are al;l glad that we could be of help.