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 |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
 |
|
01-01-2009, 09:08 AM
|
#1
|
LQ Guru
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,196
|
Reboot computer after partitition add
I added a new (logical) partition to my primary hard disk. There was no way I could udev make to recognize that partition. The recommended way to use hdparm yielded:
Code:
jlinkels-lt:/usr/bin# hdparm -z /dev/sda
/dev/sda:
re-reading partition table
BLKRRPART failed: Device or resource busy
Actually I had to reboot the computer as to have the new partition show up in /dev/hdparm
Rebooting after a partition addition? What did I miss?
jlinkels
|
|
|
01-01-2009, 04:44 PM
|
#2
|
Member
Registered: Mar 2001
Location: UK
Distribution: Mint 22, Arch, Ubuntu 22.04, Fedora 41
Posts: 195
Rep:
|
Whenever I've created, modified or deleted a partition with linux fdisk, after writing the changes and exiting fdisk,there is a message stating partition table will be re-synced on reboot.
I may be wrong here, but I think that a reboot is normal to let the kernel know about the partition changes.
|
|
|
01-01-2009, 04:58 PM
|
#3
|
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,415
|
partprobe might work - or not. I've had both it and hdparm -z fail to do the job.
Reboot is a surefire fix - if not always convenient.
|
|
|
01-01-2009, 11:48 PM
|
#4
|
Member
Registered: Jun 2008
Posts: 85
Rep:
|
Quote:
Originally Posted by jlinkels
Rebooting after a partition addition? What did I miss?
|
If disk is in use, I've always had to reboot. If you want real freedom, then try LVM. Very convenient as well if you tend to change fs sizes often.
|
|
|
01-02-2009, 06:21 AM
|
#5
|
LQ Guru
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,196
Original Poster
|
Quote:
Originally Posted by hal8000b
I may be wrong here, but I think that a reboot is normal to let the kernel know about the partition changes.
|
Why would it be normal to tell the kernel such things only during a reboot? One should be able to tell the kernel changes at all times. Only when the kernel itself needs to be reloaded, e.g. after installing a new one a reboot might be needed.
Quote:
Originally Posted by syg00
partprobe might work - or not. I've had both it and hdparm -z fail to do the job.
Reboot is a surefire fix - if not always convenient.
|
I heard about that one, but it is not available in Debian, or it was hidden too well. OK, I know the world is larger than just Debian but I was reluctant to install a non-Debian package. It seems like I have to find it anyway.
Quote:
Originally Posted by avalonit
If disk is in use, I've always had to reboot. If you want real freedom, then try LVM. Very convenient as well if you tend to change fs sizes often.
|
LVM would need some thorough study, but I heard many advantages of using it. Might do someday.
Thanks all
jlinkels
|
|
|
01-02-2009, 08:57 PM
|
#6
|
LQ Newbie
Registered: Jul 2008
Posts: 4
Rep:
|
new partition
Are the physical partitions already used up? Why a logical partition called hda? I can understand an logical partition name of hda4 or hda5, given that the first 3 or so partitions are physical.
I'm no expert but I've done some partitioning, especially today, as I'm installing a new linux distro or three. The name hda may be referring to the mbr or the drive as a whole.
Best of luck.
|
|
|
01-02-2009, 11:53 PM
|
#7
|
Senior Member
Registered: Nov 2004
Distribution: Mint, MX, antiX, SystemRescue
Posts: 2,337
|
Quote:
Originally Posted by jlinkels
Rebooting after a partition addition? What did I miss?
|
Changing partitioning on the fly under a running OS is like reaching out the window and scraping the bugs off your airplanes windshield while flying. Chances of a successful and uneventful outcome are slim, no matter how many people brag that they've done it. It's always safer to land the airplane first.
|
|
|
01-03-2009, 04:03 AM
|
#8
|
Member
Registered: May 2006
Location: Adelaide, South Australia
Distribution: Fedora 6-17 x64 / Ubuntu 10.x x64
Posts: 95
Rep:
|
Quote:
Originally Posted by haertig
Changing partitioning on the fly under a running OS is like reaching out the window and scraping the bugs off your airplanes windshield while flying. Chances of a successful and uneventful outcome are slim, no matter how many people brag that they've done it. It's always safer to land the airplane first.
|
Mangling partition tables of a disk that the OS isn't running on, is quite fine, and has worked for me 99% of the time. (Just once I made a typo, and had to cancel out of sfdisk before committing)
Mangling the partition table of the disk the OS is running on, is a little more hazardous, as you need to perform the reboot ASAP afterwards, or data can be read from / written to areas that the new partition table will not reflect until the reboot. Fun times.
I assume the "/dev/hda" mentioned is a typo and needs an actual partition number, as you can't add a logical partition as a device.
|
|
|
01-03-2009, 07:30 AM
|
#9
|
LQ Guru
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,196
Original Poster
|
Quote:
Originally Posted by haertig
Changing partitioning on the fly under a running OS is like reaching out the window and scraping the bugs off your airplanes windshield while flying. Chances of a successful and uneventful outcome are slim, no matter how many people brag that they've done it. It's always safer to land the airplane first.
|
I don't see any harm in adding a partition to unpartitioned space. As long as the mounted partitions are not changed there should be nothing to worry. Non-mounted partitions do not take part in the kernel process in any way, regardless whether they are on the same device. And... how would you ever change partitions if the OS it not running?
jlinkels
|
|
|
01-03-2009, 07:33 AM
|
#10
|
Senior Member
Registered: Mar 2007
Location: Russia
Distribution: Slackware 12.2
Posts: 1,202
Rep:
|
Quote:
Originally Posted by jlinkels
What did I miss?
|
Try "hdparm -z" or "partprobe".
|
|
|
01-03-2009, 07:35 AM
|
#11
|
LQ Guru
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,196
Original Poster
|
Quote:
Originally Posted by Gigabitten
Are the physical partitions already used up? Why a logical partition called hda? I can understand an logical partition name of hda4 or hda5, given that the first 3 or so partitions are physical.
I'm no expert but I've done some partitioning, especially today, as I'm installing a new linux distro or three. The name hda may be referring to the mbr or the drive as a whole.
Best of luck.
|
There can only be 4 physical partitions on a hard disk as the partition table has only that much space to hold the description of the tables. Therefor usually one of the physical partitions is created to be extended. That is, it will be one physical partition, but it can be divided in an arbitrary number of logical partitions. You see only the logical ones, the OS takes car of that. The extended partition is always the last partition on disk, after you created the extended one, all space is used up and you only can create further logical ones, no physical ones.
jlinkels
|
|
|
01-03-2009, 07:56 AM
|
#12
|
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,415
|
Quote:
Originally Posted by jlinkels
The extended partition is always the last partition on disk, after you created the extended one, all space is used up and you only can create further logical ones, no physical ones.
|
You were doing o.k. till you got to this bit.
Not true at all.
(I presume you mean "primary")
Last edited by syg00; 01-03-2009 at 07:58 AM.
|
|
|
01-03-2009, 08:17 AM
|
#13
|
LQ Guru
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,196
Original Poster
|
Yes, I meant primary. sed s/physical/primary/g and it is correct again.
jlinkels
|
|
|
01-03-2009, 12:27 PM
|
#14
|
Senior Member
Registered: Nov 2004
Distribution: Mint, MX, antiX, SystemRescue
Posts: 2,337
|
Quote:
Originally Posted by jlinkels
I don't see any harm in adding a partition to unpartitioned space.
|
No, there is no problem there. You can certainly add the partition. But to start using it (making a new filesystem, mounting, etc.) then it's best to reboot first.
Quote:
And... how would you ever change partitions if the OS it not running?
|
You change your partitions with that running OS, and then reboot. Attempting to continue on without a reboot is risky IMHO. It may work, it may not.
Whenever I'm doing major partitioning work (not just adding a new partition to unallocated space), I always do it from a LiveCD. First, I backup the entirety of Track Zero (so I include my bootloader stub) to an external USB thumbdrive. This is so I can recover/troubleshoot if things go bad. I don't find much need for partitioning work these days anyway - I started using LVM several years ago and love it.
|
|
|
01-04-2009, 12:21 AM
|
#15
|
Member
Registered: Jun 2008
Posts: 85
Rep:
|
Quote:
Originally Posted by haertig
No, there is no problem there. You can certainly add the partition. But to start using it (making a new filesystem, mounting, etc.) then it's best to reboot first.
|
Please keep such advise for windows forums ;p
Quote:
Originally Posted by haertig
You change your partitions with that running OS, and then reboot. Attempting to continue on without a reboot is risky IMHO. It may work, it may not.
|
It will work if you did it right and the disk was not already in use (which should be reported by the partitioning program).
Quote:
Originally Posted by haertig
Whenever I'm doing major partitioning work (not just adding a new partition to unallocated space), I always do it from a LiveCD. First, I backup the entirety of Track Zero (so I include my bootloader stub) to an external USB thumbdrive. This is so I can recover/troubleshoot if things go bad.
|
Backup is a good thing and I would recommend it as well. But I can't see anything safer doing the operation from a life CD. Of course you need one if you screw up
Quote:
Originally Posted by haertig
I don't find much need for partitioning work these days anyway - I started using LVM several years ago and love it.
|
Yes, LVM is easy and somehow safer (warns you if you try to do something really stupid although not foolproof). And you don't need a reboot.
|
|
|
All times are GMT -5. The time now is 09:10 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|