LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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


Reply
  Search this Thread
Old 01-01-2009, 09:08 AM   #1
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
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
 
Old 01-01-2009, 04:44 PM   #2
hal8000b
Member
 
Registered: Mar 2001
Location: UK
Distribution: Mint, Arch, Debian7
Posts: 194

Rep: Reputation: 23
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.
 
Old 01-01-2009, 04:58 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,147

Rep: Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124
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.
 
Old 01-01-2009, 11:48 PM   #4
avalonit
Member
 
Registered: Jun 2008
Posts: 81

Rep: Reputation: 19
Quote:
Originally Posted by jlinkels View Post
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.
 
Old 01-02-2009, 06:21 AM   #5
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Original Poster
Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
Quote:
Originally Posted by hal8000b View Post
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
 
Old 01-02-2009, 08:57 PM   #6
Gigabitten
LQ Newbie
 
Registered: Jul 2008
Posts: 4

Rep: Reputation: 0
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.
 
Old 01-02-2009, 11:53 PM   #7
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,331

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
Quote:
Originally Posted by jlinkels View Post
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.
 
Old 01-03-2009, 04:03 AM   #8
LaughingBoy
Member
 
Registered: May 2006
Location: Adelaide, South Australia
Distribution: Fedora 6-17 x64 / Ubuntu 10.x x64
Posts: 95

Rep: Reputation: 16
Arrow

Quote:
Originally Posted by haertig View Post
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.
 
Old 01-03-2009, 07:30 AM   #9
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Original Poster
Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
Quote:
Originally Posted by haertig View Post
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
 
Old 01-03-2009, 07:33 AM   #10
ErV
Senior Member
 
Registered: Mar 2007
Location: Russia
Distribution: Slackware 12.2
Posts: 1,202
Blog Entries: 3

Rep: Reputation: 62
Quote:
Originally Posted by jlinkels View Post
What did I miss?
Try "hdparm -z" or "partprobe".
 
Old 01-03-2009, 07:35 AM   #11
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Original Poster
Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
Quote:
Originally Posted by Gigabitten View Post
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
 
Old 01-03-2009, 07:56 AM   #12
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,147

Rep: Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124
Quote:
Originally Posted by jlinkels View Post
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.
 
Old 01-03-2009, 08:17 AM   #13
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Original Poster
Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
Yes, I meant primary. sed s/physical/primary/g and it is correct again.

jlinkels
 
Old 01-03-2009, 12:27 PM   #14
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD, Raspbian, Arch
Posts: 2,331

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
Quote:
Originally Posted by jlinkels View Post
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.
 
Old 01-04-2009, 12:21 AM   #15
avalonit
Member
 
Registered: Jun 2008
Posts: 81

Rep: Reputation: 19
Quote:
Originally Posted by haertig View Post
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 View Post
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 View Post
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 View Post
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Computer goes black and reboot inverted.gravity Linux - Hardware 4 01-14-2007 11:28 AM
Computer in endless reboot cycle apocoloco Linux - Software 3 09-12-2005 07:58 AM
Computer requires reboot after idle mpn Slackware 1 10-28-2004 07:21 PM
Slack reboot my computer laurentbon Slackware 4 08-29-2003 04:20 AM
How to add RAID1 without a reboot G../ Linux - Newbie 1 07-20-2002 10:46 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration