LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   This is it! Blowing out windows but first, a LILO question et al... (https://www.linuxquestions.org/questions/slackware-14/this-is-it-blowing-out-windows-but-first-a-lilo-question-et-al-865971/)

Robert.Thompson 03-02-2011 09:04 AM

This is it! Blowing out windows but first, a LILO question et al...
 
Hello:

I would like to get rid of windows XP from my laptop. I have CloneZilla images of my root & home partitions. I have just recently scrapped Grub and switched to LILO installed to the MBR.

Here are my questions:
  1. Because I installed LILO to the MBR, should I reinstall it to my Slackware root partition (or somewhere else) prior to blowing out the XP partition where, I assume, the MBR is living?
  2. Once I repartition my disk for Slackware only and 'Clonezilla back' my root and home partitions, how do I boot into Slackware?
  3. Once I successfully boot into Slackware, what do I do with LILO so that my PC boots into Slackware for ever after? (Amen)

Added:
Would I just repartition, clonezilla back root & home and boot from the Slackware DVD into 'huge' in my new root and then update LILO?

Thanks for any guidance with this.

rcbrgs 03-02-2011 10:05 AM

Hi Rob!

I have never used Clonezilla so use my input at your own risk.

There are two types of installation of LILO: one installs in the MBR and the other to the partition. When the computer boots, it *only* looks at the MBR. If it has a LILO, it will load that LILO.

It only boots a partition LILO if your MBR LILO tells it to do so (in a sort of "two steps" boot process).

This partition LILO is not terribly useful for a newbie, when I use LILO in this way I do so only to have first a choice of OS, and then of kernel. I do not think it will help you very much in your reconfig of your laptop.

I suppose you have XP on your first partition, and Slack somewhere else. Your current LILO config boots from the MBR and can select the kernel in the Slack partition, which is working right now.

Since you plan on repartitioning your drive and "de-cloning" your OS in the new layout, you should be able to reinstall LILO to the MBR after you delete the XP partition, and keep using your Slack system.

However repartitioning will (possibly) create devices that you actually use for root and for home with different names than the ones you use right now. You must make Slack aware of these changes.

This is done editing the /etc/fstab file.

Since you already cloned your system, this is how I would try to do this:

1 - Repartition your system to your liking. Write down the devices for / and for /home.
2 - Copy everything to their new places.
3 - Boot with the Slack install DVD, reinstall the LILO to the MBR. Use the installer shell (e.g., Alt+F2) to:
3.1 - Mount your new root device somewhere (you might have to create a directory for this, e.g., /mnt/root).
3.2 - Edit your /etc/fstab file. (Which would be in /mnt/root/etc/fstab).

And reboot, with your fingers crossed.

Alternatively, since you have a different partition for / and /home (good!), you should be able to install a new Slack in / and keep your /home. This would simplify things a lot.

HTH,
Renato.

Ilgar 03-02-2011 10:16 AM

MBR does not live in a partition, so if you delete the XP partition lilo will still be there. I don't know how Clonezilla works so I can't comment on the rest. But do you really need to repartition the whole disk? You haven't given the sizes but if I was in this situation I'd try to keep the install and move some files (if necessary) to the new partition.

For example if I had 5 GB Linux and 10 GB XP, after formatting the 10GB part for Linux I'd move the /home or /usr directory (whichever needs more space) to the new partition. The bulk of the system-installed software is in /usr, but you may need a really big /home, or /opt, or whatever... You pick. I'd do this by 1) booting with a Live distribution or the Slackware install CD, 2) cloning, say, the /usr directory to the new partition, 3) editing /etc/fstab to tell the system to mount the new partition to /usr. As long as /boot is not moved elsewhere and MBR is not erased, the kernel will boot. If you setup fstab correctly it should mount the new partition as /usr/ and continue to work there.

Darth Vader 03-02-2011 10:26 AM

Quote:

Originally Posted by Robert.Thompson (Post 4276394)
Hello:

I would like to get rid of windows XP from my laptop. I have CloneZilla images of my root & home partitions. I have just recently scrapped Grub and switched to LILO installed to the MBR.

Here are my questions:
  1. Because I installed LILO to the MBR, should I reinstall it to my Slackware root partition (or somewhere else) prior to blowing out the XP partition where, I assume, the MBR is living?
  2. Once I repartition my disk for Slackware only and 'Clonezilla back' my root and home partitions, how do I boot into Slackware?
  3. Once I successfully boot into Slackware, what do I do with LILO so that my PC boots into Slackware for ever after? (Amen)

Added:
Would I just repartition, clonezilla back root & home and boot from the Slackware DVD into 'huge' in my new root and then update LILO?

Thanks for any guidance with this.

Maybe you can do everything in command line, without Clonezilla, like a true Slack Padawan! ;)

Here we go!

First, tell me your partitions layout, with:

Code:

parted -s /dev/sda print

Robert.Thompson 03-02-2011 10:44 AM

Hi Darth:

Here is the output:
Code:

root@darkstar:/# parted -s /dev/sda print
Model: ATA HITACHI HTS54161 (scsi)
Disk /dev/sda: 160GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start  End    Size    Type      File system    Flags
 1      32.3kB  10.5GB  10.5GB  primary  ntfs            boot
 2      10.5GB  21.0GB  10.5GB  primary  ntfs
 3      21.0GB  25.7GB  4719MB  primary  linux-swap(v1)
 4      25.7GB  160GB  134GB  extended
 5      25.7GB  27.8GB  2097MB  logical  ext4
 6      27.8GB  29.9GB  2097MB  logical  ext4
 7      29.9GB  71.8GB  41.9GB  logical  ext4
 8      71.8GB  160GB  88.2GB  logical  ext4

root@darkstar:/#

sda1 is windows XP programs
sda2 is windows XP data
sda5 & sda6 are not used
sda7 is Slackware root
sda8 is Slackware home

Darth Vader 03-02-2011 10:50 AM

Then, you want to 'kill with fire' all NTFS partitions content? :)

Also, for the next step, we need the output of:

Code:

df -h

Robert.Thompson 03-02-2011 10:56 AM

Quote:

Originally Posted by Darth Vader (Post 4276506)
Then, you want to 'kill with fire' all NTFS partitions content? :)

Also, for the next step, we need the output of:

Code:

df -h

Yes, I would just like to end up with 2 partitions: root & home.

Code:

root@darkstar:/# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/root              39G  8.1G  29G  23% /
/dev/sda8              81G  8.9G  68G  12% /home
tmpfs                1.5G  296K  1.5G  1% /dev/shm
/dev/sda1            9.8G  4.2G  5.7G  43% /winxp
/dev/sda2            9.8G  52M  9.8G  1% /windata
root@darkstar:/#


Darth Vader 03-02-2011 11:11 AM

Quote:

Originally Posted by Robert.Thompson (Post 4276510)
Yes, I would just like to end up with 2 partitions: root & home.

Cool! How about to end up with 3 partitions: root, swap and home?

First of all, umount the windows partitions, comment them in /etc/fstab and change their partition types to 83 / Linux, using the cfdisk. If cfdisk claim about "unable to reread partition table", run after partprobe.

Robert.Thompson 03-02-2011 11:30 AM

Quote:

Originally Posted by Darth Vader (Post 4276530)
Cool! How about to end up with 3 partitions: root, swap and home?

First of all, umount the windows partitions, comment them in /etc/fstab and change their partition types to 83 / Linux, using the cfdisk. If cfdisk claim about "unable to reread partition table", run after partprobe.

I get a different error:
Code:

                  FATAL ERROR: Bad primary partition 3: Partition ends in the final partial cylinder
                                            Press any key to exit cfdisk


Darth Vader 03-02-2011 11:39 AM

Quote:

Originally Posted by Robert.Thompson (Post 4276555)
I get a different error:
Code:

                  FATAL ERROR: Bad primary partition 3: Partition ends in the final partial cylinder
                                            Press any key to exit cfdisk


No problem. Looks like we have a partition table error, usual for wincrap tools. You should use fdisk to change the partition types. It's more unfriendly, but more powerful.

I suggests to keep open a man page in another konsole tab.

Technically, is something like:

Code:

bash-4.1# fdisk /dev/sda

Command (m for help): m
Command action
  a  toggle a bootable flag
  b  edit bsd disklabel
  c  toggle the dos compatibility flag
  d  delete a partition
  l  list known partition types
  m  print this menu
  n  add a new partition
  o  create a new empty DOS partition table
  p  print the partition table
  q  quit without saving changes
  s  create a new empty Sun disklabel
  t  change a partition's system id
  u  change display/entry units
  v  verify the partition table
  w  write table to disk and exit
  x  extra functionality (experts only)

Command (m for help): t
Partition number (1-4): 1
Hex code (type L to list codes): 83
Changed system type of partition 1 to 83 (Linux)

Command (m for help): t
Partition number (1-4): 2
Hex code (type L to list codes): 83

...

/dev/sda1 is partition 1
/dev/sda2 is partition 2

To write to disk, use the command w.

Robert.Thompson 03-02-2011 11:56 AM

Hi Darth:

Here is the msg I got after doing 'w' in fdisk:
Code:

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.
root@darkstar:/#


Darth Vader 03-02-2011 11:57 AM

Quote:

Originally Posted by Robert.Thompson (Post 4276600)
Hi Darth:

Here is the msg I got after doing 'w' in fdisk:
Code:

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.
root@darkstar:/#


Perfect! Execute partprobe.

Robert.Thompson 03-02-2011 12:01 PM

Hi Darth:

Here's what happend:
Code:

root@darkstar:/# partprobe /dev/sda
Warning: WARNING: the kernel failed to re-read the partition table on /dev/sda (Device or resource busy).  As a result, it may not reflect all of your changes until after reboot.
root@darkstar:/#


Darth Vader 03-02-2011 12:05 PM

Quote:

Originally Posted by Robert.Thompson (Post 4276607)
Hi Darth:

Here's what happend:
Code:

root@darkstar:/# partprobe /dev/sda
Warning: WARNING: the kernel failed to re-read the partition table on /dev/sda (Device or resource busy).  As a result, it may not reflect all of your changes until after reboot.
root@darkstar:/#


Yeah, it's right, because we have active partitions, beyound these main partitions. What we do:

1. Execute:

Code:

mkfs.ext4 /dev/sda1
mkfs.ext4 /dev/sda2

2. Modify in the /etc/fstab the (old windows) partitions filesystem to ext4 and uncomment it.

3. What all apps want: reboot.

Robert.Thompson 03-02-2011 12:14 PM

Quote:

Originally Posted by Darth Vader (Post 4276610)

3. What all apps want: reboot.

I should reboot now?


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