Wednesday, June 24, 2015

Add new hard disk partition to ubuntu guest

install by force after dpkg dependency problem

You can fix this by installing missing dependencies.
Just run the following command
(after you have run sudo dpkg -i google-chrome-stable_current_i386.deb).
sudo apt-get install -f
This will install missing dependencies and configure Google Chrome for you.

MBR or GPT

MBR works with disks up to 2 TB in size, but it can’t handle disks with more than 2 TB of space. MBR also only supports up to four primary partitions — if you want more, you have to make one of your primary partitions an “extended partition” and create logical partitions inside it. This is a silly little hack and shouldn’t be necessary

GPT allows for a nearly unlimited amount of partitions, and the limit here will be your operating system — Windows allows up to 128 partitions on a GPT drive, and you don’t have to create an extended partition

Fdisk does not work for gpt, currently. But parted does. Or you can just easily install gdisk.

Over 1.5TB (if drive is unpartitioned) or is UEFI it defaults to gpt, otherwise it defaults to MBR

Prepare a MBR partition table
         #list new hard disk device for MBR
         fdisk -l
         #Partition type has to be primary
         fdisk /dev/sdb
       

Prepare a GPT partition table
$ sudo parted -l
sudo parted /dev/sda
#MBR DISK
(parted)mklabel msdos 
#GPT DISK
(parted)mklabel gpt  
 (parted)mkpart primary xfs 0 100%
 (parted) quit

mkfs -t xfs /dev/sdb1



#verify the file system mounted
cat /proc/mount

#find all block devices
ls /sys/block

#block device attribute
blkid


Mount swift disk automatically at system boot with Upstart script
$cat /opt/swift/bin/mount_devices

mount -t xfs -o noatime,nodiratime,logbufs=8 /dev/sdb1 /srv/node/d1

$chmod +x /opt/swift/bin/mount_devices

$mkdir -p /srv/node/b1

$chown -R swift:swift /srv/node

Next, create an Upstart script in the /etc/init directory called start_swift.conf with the following commands:

description "mount swift drives"
start on runlevel [234]
stop on runlevel [0156]
exec /opt/swift/bin/mount_devices



10 Ways to Generate a Random 32 byte strings from the Command Line

date +%s | sha256sum | base64 | head -c 32 ; echo
openssl rand -base64 32

[swift-hash]
swift_hash_path_suffix = head -c 64 /dev/random | base64
swift_hash_path_prefix = head -c 64 /dev/random | base64



Creating the Log Configuration File

Create a configuration file named 0-swift.conf in the /etc/rsyslog.d directory. It will contain
one line:
local0.* /var/log/swift/all.log
Since we just created a script that will tell the system to log the all.log file in the directory
/var/log/swift, we will need to create that directory and set the correct permissions
on it.
This command will create the directory the log files will be created in:

mkdir /var/log/swift
You also need to set permissions on the directory so the log process can write to it. For
instance, the following commands do this on Ubuntu:
chown -R syslog.adm /var/log/swift
chmod -R g+w /var/log/swift

No comments:

Post a Comment