Ubuntu – Disk Utility

Posted by 춘자 리눅스/리눅스설정 : 2014.05.07 19:21

When you install Ubuntu 10.04 Desktop, the default menu item for Disk Utility isn’t extremely useful; after all, it’s on the System->Administration menu, so you would assume that it’s meant to administer the machine, not just view the disk configuration.


What I’m alluding to is that by default Disk Utility (/usr/bin/palimpsest) is not run with elevated privileges (as super-user), but rather as the current user — which if you’re doing as you should be, that’s means you won’t be able to effect any changes, and Disk Utility will probably end up being a waste of time and effort.


To correct this problem all you need do is modify the menu item which launches Disk Utility to elevate your privileges before launching (using gksu) — that, of course, assumes that you’re permitted to elevate your privileges.


To do add privilege elevation to disk utility:


1. Right click your mouse on the menu bar along the top (right on system is good) and select ‘edit menu items’

2. Navigate down to ‘administration’ and select it in the left pane. Select ‘disk utility’ in the right pane

3. Select ‘properties’ in the buttons on the right

4. Under ‘command’ prefix it with ‘gksu’ or substitute ‘gksu /usr/bin/palimpsest’ (putting the entire path there)

5. Then click ‘close’ and ‘close’ again…


출 처 : http://rogersoles.com/technology/ubuntu-disk-utility/

댓글을 달아 주세요

  1. 2015.05.06 21:43  댓글주소  수정/삭제  댓글쓰기

    비밀댓글입니다

  2. 2016.08.24 14:40  댓글주소  수정/삭제  댓글쓰기

    비밀댓글입니다


1

Become root

You will need super user privileges, do and enter authorize as needed

1su -

2

Where on Linux is my new hard disk?

One way to find new, avalaible but not partitioned device, is to use ls /dev/s*

1[root@thinkplexx ~]# ls /dev/s*
2/dev/sda   /dev/sda2  /dev/sdb1  /dev/sg1  /dev/snapshot  /dev/stdin   /dev/systty
3/dev/sda1  /dev/sdb   /dev/sdc   /dev/sg0   /dev/sg2  /dev/stderr    /dev/stdout

Here, we can see that /dev/sda, /dev/sdb etc all have been partitioned:

1/dev/sda
2/dev/sda1
3...
4/dev/sdb
5/dev/sdb1
6...

/dev/sdc is available as a phisical device but has no partitions like /dev/sdc1, /dev/sdc2 etc.

3

Use fdisk to make partitions

3.1

Start fdisk

fdisk /dev/sdc :

1[root@thinkplexx ~]# fdisk /dev/sdc
2The number of cylinders for this disk is set to 33418.
3There is nothing wrong with that, but this is larger than 1024,
4and could in certain setups cause problems with:
51) software that runs at boot time (e.g., old versions of LILO)
62) booting and partitioning software from other OSs
7   (e.g., DOS FDISK, OS/2 FDISK)

Message is common for newer disks and selfexplaining. Says that you might have problems with older LILO’s and double booting systems.

3.2

Get disk info

You are inside fdisk now

1Command (m for help): [type p]
2 
3Disk /dev/sdc: 274.8 GB, 274877906944 bytes
4255 heads, 63 sectors/track, 33418 cylinders
5Units = cylinders of 16065 * 512 = 8225280 bytes

Yep, disk is there, but no partitions.

3.3

Add a primary partition

We just take all space for one partition:

01Command (m for help): [type n]
02Command action
03   e   extended
04   p   primary partition (1-4)
05[type p]
06Partition number (1-4): [type 1]
07First cylinder (1-621, default 1): [type RETURN]
08Using default value 1
09Last cylinder or +size or +sizeM or +sizeK (1-33418, default 33418):  [typeRETURN]
10Using default value 33418

Verify new partition table, in my case it would be:

1Command (m for help): p
2...
3   Device Boot      Start         End      Blocks   Id  System
4/dev/sdc1               1       33418   268430053+  83  Linux

3.4

Write table to disk and exit

After you verified that your changes are ok, use w to write new partition table.
If you don’t use “w”, no changes will happen, no new partitions will be creted.

4

Format disk

now, if you try ls /dev/s* , there will be /dev/sdc1 partition available:

1[root@thinkplexx ~]# ls /dev/s*
2/dev/sda   /dev/sda2  /dev/sdb1  /dev/sdc1 /dev/sg1  /dev/snapshot  /dev/stdin   /dev/systty
3/dev/sda1  /dev/sdb   /dev/sdc   /dev/sg0   /dev/sg2  /dev/stderr    /dev/stdout

Run mkfs.ext3 to format using ext3 filesystem.

01[root@thinkplexx ~]# mkfs.ext3 /dev/sdc1
02mke2fs 1.39 (8-May-2006)
03Filesystem label=
04OS type: Linux
05Block size=4096 (log=2)
06Fragment size=4096 (log=2)
07...
08Writing inode tables: done
09Creating journal (268430053 blocks): done
10Writing superblocks and filesystem accounting information: done
11 
12This filesystem will be automatically checked every 36 mounts or
13180 days, whichever comes first.  Use tune2fs -c or -i to override.

5

Mount

Create a new mount point
mkdir /mnt/storage

Now edit fstab so that mounted device will be available after reboot and mount command may be applied on mount point.

vim /etc/fstab

You are in vim, type [e].

State that /dev/sdc1 partition should be mounted to /mnt/storage :

1/dev/sdc1               /mnt/storage            ext3    defaults        1 2

After line is added, use key combination [esc][:wq!]. Vim saves new fstab.

Mount now:
mount /mnt/storage

6

Done, new hard disk partition can be used

1[root@thinkplexx ~]# cd /
2[root@thinkplexx ~]# df -k
3Filesystem           1K-blocks      Used Available Use% Mounted on
4...
5/dev/sdc1            264218344         0  89411780  0% /mnt/storage
6...

device is ready to be used.

Have fun!

출 처 : http://www.thinkplexx.com/learn/howto/linux/system/add-partition-format-and-mount-hard-disks-on-linux-fast-and-simple-step-by-step-guide

댓글을 달아 주세요

4096 physical block size drives

Posted by 춘자 리눅스/리눅스설정 : 2014.05.02 21:09

If you buy a new hard drive today, there is a big chance that the disk has the new format of 4KB physical block size instead of the classic 512-byte. The drive willwork, however, you may experience some performance issues. I realized this when my usb2 external drive would pause -without errors or warnings- when there was heavy IO or something new was attached to the usb bus. You can query the drive to see what type of block size it has, but beware, some drives … lie.

An honest example:

$ sudo hdparm -I /dev/sde |grep size
Logical  Sector size:                   512 bytes
Physical Sector size:                  4096 bytes
device size with M = 1024*1024:     1430799 MBytes
device size with M = 1000*1000:     1500301 MBytes (1500 GB)
cache/buffer size  = unknown

Some drives may report 512 while being of the 4096 bytes type. To enhance the performance of the drive, you should align your partitions. In short, this means than when creating partitions, these need to start at a cylinder that is a factor of 8. If you only have one partition, let it start at cylinder 64.

For further reference, these are the model numbers of the Western Digital (the pioneer in 4096 byte block size) I have:

$ sudo hdparm -I /dev/sde |grep Model
Model Number:       WDC WD15EADS-11P8B1
$ sudo hdparm -I /dev/sdc |grep Model
Model Number:       WDC WD10EADS-00M2B0

(The last drive does not print having a 4096 byte block size. Because of the identical performance problem as the other one, I am sure it has that type of block size.)

The quickest solution -if you are not installing Windows XP and previous on the disk- is to format the drive without the DOS compatibility setting. E.g. (replace ‘x’ by the correct device name of your drive).

sudo fdisk -uc /dev/sdx

Command (m for help): d
Selected partition 1

Command (m for help): n
Command action
e   extended
p   primary partition (1-4)
p
Partition number (1-4): 1
First sector (2048-2930277167, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-2930277167, default 2930277167):
Using default value 2930277167

Command (m for help): t
Selected partition 1
Hex code (type L to list codes): 83

Command (m for help): p

Disk /dev/sdx: 1500.3 GB, 1500301910016 bytes
81 heads, 63 sectors/track, 574226 cylinders, total 2930277168 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
Disk identifier: 0x4fabbfc4

Device Boot      Start         End      Blocks   Id  System
/dev/sdx1            2048  2930277167  1465137560   83  Linux

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

Calling ioctl() to re-read partition table.
Syncing disks.

Use mkfs.ext4 or gparted (gui) to create a filesystem on the newly formatted drive.


출 처 : http://nxadm.wordpress.com/2010/04/30/4096-physical-block-size-drives/

댓글을 달아 주세요

 «이전 1  다음»